• Stars
    star
    929
  • Rank 49,172 (Top 1.0 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿฆ•For NPM module authors that would like to support Deno but do not want to write and maintain a port.

๐Ÿฆ• Release on NPM and on deno.land/x with a single codebase๐Ÿฆ•

Home - Documentation - Demo repo

What it is

A build tool that takes as input a TypeScript codebase that was meant to target node and/or the web and spits out a modified version of the source files ready to be deployed as a Deno module.

what_denoify_does

NOTE: Denoify is capable of recursively resolving dependencies!
It works out of the box with dependencies that uses denoify and there are many option for dealing with dependencies that won't transpile automatically. See specific documentation

This tool is mainly for NPM module publisher, to enable them to bring first-class citizen Deno support to their modules and do so without introducing breaking changes.

Deno's Support for NPM Modules: What It Means and the Continued Relevance of Denoify

Deno now supports NPM modules.
This development significantly benefits NPM module authors as it simplifies the process of integrating their modules into Deno.
You simply instruct your users to import your module using the format: import {...} from "npm:your-module@5";.

However, even with this development, there are still compelling reasons to consider using Denoify for your module:

  1. Publishing on deno.land/x: If you aspire to have your module incorporated into other Deno modules, it is crucial to release a Deno-specific distribution. Without it, your chances of significant inclusion are considerably diminished.

  2. Ensuring Retro Compatibility: Denoify ensures your module remains compatible with earlier Deno versions lacking NPM support. This retro-compatibility broadens your module's user base and applicability.

  3. Tailoring Module Adaptations: Not all NPM modules (approximately 10%) will work seamlessly with Deno out of the box. In these cases, Denoify can aid in creating Deno-specific implementations for particular files within your module (xxx.deno.ts).

Therefore, despite Deno's new NPM support, Denoify continues to offer value in ensuring wider compatibility, adaptability, and visibility for your module.

Example of modules using Denoify

Some modules that have been made cross-runtime using Denoify:

Limitations

  • If your module is vanilla JS it needs to be ported to TypeScript first1.
  • require() is not supported.
  • You can't fs.readFile() files that are part of the module ( files inside a res/ directory for example ). 2

Get started

๐Ÿš€ Quick start ๐Ÿš€

Doing without Denoify

If your project doesn't have any dependencies and isn't utilizing Node built-ins (e.g., fs, https, process), you have an alternative to Denoify. You can make use of the TypeScript compiler options moduleResolution: bundler and allowImportingTsExtensions: true. For more information, see this comment.

Please note that this technique requires the addition of .ts extension to your source file imports. This could lead to potential compatibility issues with certain tools, and require an adjustment period.

What's new

NEW IN v1.6.0

  • Support for Deno environnement variable (Deno.env('XYZ')). Thank you to @dancrumb for this feature. See issue

NEW IN v1.3.1

NEW IN v1.3

  • Support for // @denoify-line-ignore special comment.

NEW IN v1

  • import express from "express"; automatically converted into:
    import express from "npm:express@5";
    (See this update)
    Most project will now transpile successfully out of the box.

NEW IN v0.10

  • Mitigate the risk of comment being accidentally modified.
  • Possibility to specify output directory in the package.json's denoify field. See doc.
  • Support module augmentation: declare module .... Example
  • Possibility to explicitly tell where the index.ts is located in the source. Doc

NEW IN v0.9

  • tsconfig.json can be absent if outputDir is specified. See @zxch3n's PR
  • Enable to configure the name of the output dir. It no longer has to be deno_dist. See @zxch3n's PR

NEW IN v0.7

  • Support for esm modules. See issue. Thanks to yandeu.

NEW IN v0.7

  • Support for workspaces where node_modules are located in a parent directory.
    Thx @hayes See issue
  • Add basic support for child_process.spawn (#785)

NEW IN v0.6

NEW IN v0.5 Breaking changes

  • All Denoify parameters are now gathered under a uniq "denoify" field.
  • Possibility to specify which files should be copied to the deno_dist directory (Previously only README.md was copied).
    Valid config example

Introduction video

NOTE: New features have been introduced since this meeting was hold

Watch the video

Footnotes

  1. Don't be afraid, renaming your source with .ts and dropping some any here and there will do the trick. You will be able to pull it off even if you aren't familiar with typescript. Ref โ†ฉ

  2. In Deno the files that forms your module wonโ€™t be pre-fetched and placed in node_module like in node so you wonโ€™t be able to access files that are not on the disk. โ†ฉ

More Repositories

1

tss-react

โœจ Dynamic CSS-in-TS solution, based on Emotion
TypeScript
631
star
2

evt

๐Ÿ’งEventEmitter's typesafe replacement
TypeScript
427
star
3

tsafe

๐Ÿ”ฉ The missing TypeScript utils
TypeScript
400
star
4

ts-ci

๐Ÿš€ A starter for TS projects meant to be published on NPM.
TypeScript
321
star
5

i18nifty

๐ŸŒŽ Type safe React i18n library
TypeScript
146
star
6

clean-architecture

๐Ÿ“ A clean architecture framework
TypeScript
47
star
7

run_exclusive

โšก๐Ÿ”’ Wait queue for function execution ๐Ÿ”’ โšก
TypeScript
28
star
8

powerhooks

A collection of powerfull react hooks
TypeScript
26
star
9

chan-dongle-extended

An extention for chan_dongle: PIN codes, multipart SMS, contacts.
TypeScript
23
star
10

keycloakify-advanced-starter

A starter and demo project for Keycloakify v6 - Component level customization.
TypeScript
17
star
11

keycloakify-starter

A starter and demo project for Keycloakify v6 - CSS level customization.
TypeScript
10
star
12

chan-dongle-extended-pages

Shell
6
star
13

my_dummy_npm_and_deno_module

Example/tutorial on how to setup denoify
TypeScript
6
star
14

github-pages-plugin-for-type-route

Feature create-react-app/type-route/gh-pages compatibility
JavaScript
5
star
15

denoify_ci

โœ… Continuous integration setup for modules using denoify
TypeScript
5
star
16

nextra-dsfr-demo

A demo project for nextra-theme-dsfr-docs
TypeScript
4
star
17

ts-promisify

Module to help work in sequencial mode with typeScript thanks to async/await
TypeScript
3
star
18

fp-ts-test-ci

test ci
TypeScript
3
star
19

asterisk

Fork of Asterisk 14.5. Version exploited by Semasim.
C
3
star
20

resume

Curriculum Vitae of Joseph Garrone
HTML
3
star
21

fuzzy-octo-guacamole

A playground for testing CI setup that deploys on Deno and NPM
TypeScript
3
star
22

ts-async-agi

Async agi implementation for node targeting typescript users ( fork from agi-node )
JavaScript
2
star
23

releases

2
star
24

working_environnement

My vim plugins, vimrc and bashrc
Vim Script
2
star
25

react-dsfr-next-demo

๐Ÿš€ Starter Next + react-dsfr + MUI + TSS
TypeScript
2
star
26

ts-ami

An Asterisk manager API client
TypeScript
2
star
27

www.semasim.com

HTML
1
star
28

test-repo

Description changed
1
star
29

semasim-backend

TypeScript
1
star
30

react-screen-scaler

๐Ÿ–ฅ๏ธ๐Ÿ” Design Once, Render Everywhere: Screen-size agnostic React development for uniform environments
TypeScript
1
star
31

ts-sip

A collection of low lever tools to work with the SIP protocol.
TypeScript
1
star
32

node-remove-photo-duplicate

A script to remove duplicate of the same photos
JavaScript
1
star
33

evt_react_hooks_todo_list

Created with StackBlitz โšก๏ธ
TypeScript
1
star
34

dark-mode-ssr-demo

Demo of how to have dark mode + SSR without white flash.
CSS
1
star
35

chan-dongle-extended-client

https://garronej.github.io/chan-dongle-extended-pages/
TypeScript
1
star
36

mui-next-appdir-demo

MUI Next AppDir demo (using tss-react tooling)
TypeScript
1
star
37

evt.land

Landing page for the EVT project
EJS
1
star
38

crypto-lib

TypeScript
1
star
39

vigilant-doodle

TypeScript
1
star
40

semasim-gateway

TypeScript
1
star
41

keycloakify-demo-app-css-only

FreeMarker
1
star