- v1.6.16Latest
- v1.6.15
- v1.6.15-rc.1
- v1.6.15-rc.0
- v1.6.14
- v1.6.13
- v1.6.12
- v1.6.11
- v1.6.10
- v1.6.9
- v1.6.8
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.1
- v1.6.0
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.6
- v1.1.5
- v1.2.0-beta.0
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.16.0
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.1
- v0.14.0
- v0.13.1
- v0.13.0
- v0.12.0
- v0.11.7
- v0.11.6
- v0.11.5
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.6
- v0.10.5
- v0.10.4
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.12
- v0.5.11
- v0.5.10
- v0.5.9
- v0.5.8
- v0.5.7
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.4.14
- v0.4.13
- v0.4.12
- v0.4.11
- v0.4.10
- v0.4.9
- v0.4.8
- v0.4.7
- v0.4.6
š¦ Release on NPM and on deno.land/x with a single codebaseš¦
Home - Documentation - Demo repo
Aug 2024 Update: At this point in time itās probably wiser to use JSR.
JSR is an initiative from the Deno team that provide a solution to a superset of the problems Denoify solves.
Hono that was using Denoify has been migrated to JSR.
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.
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:
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.
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.
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:
hono(Migrated to JSR)- EVT
- Nano JSX
- eta
- graphql-helix
- tsafe
- Automerge
- ā¦and many others
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 ares/
directory for example ). 2
Get started
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
- Denoify now has a proper documentation website!
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
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
- Built in support for graphQL.
See how graphql-helix got graphql working beforev0.6
using a custom replacer referenced in thepackage.json
.
You can do the same with other modules using skypack.dev or jspm - It is now possible to use
console.log()
in custom replacers to help debug. - Some support for
crypto
node builtin.
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 onlyREADME.md
was copied).
Valid config example
Introduction video
NOTE: New features have been introduced since this meeting was hold
Footnotes
-
Donāt be afraid, renaming your source with
.ts
and dropping someany
here and there will do the trick. You will be able to pull it off even if you arenāt familiar with typescript. Ref ā© -
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. ā©