{"id":13432994,"url":"https://github.com/garronej/denoify","last_synced_at":"2025-05-14T08:06:23.696Z","repository":{"id":37826838,"uuid":"241567412","full_name":"garronej/denoify","owner":"garronej","description":"🦕For NPM module authors that would like to support Deno but do not want to write and maintain a port.","archived":false,"fork":false,"pushed_at":"2025-02-27T22:42:59.000Z","size":4636,"stargazers_count":942,"open_issues_count":13,"forks_count":21,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-29T00:43:03.559Z","etag":null,"topics":["build-tool","deno","hacktoberfest","jspm","node-builtin","support-deno","sypack"],"latest_commit_sha":null,"homepage":"http://denoify.land","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garronej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["garronej"]}},"created_at":"2020-02-19T08:14:30.000Z","updated_at":"2025-04-08T20:18:09.000Z","dependencies_parsed_at":"2024-01-16T23:16:00.675Z","dependency_job_id":"5b69d5d6-e6f9-4dbf-b446-c4a16226d902","html_url":"https://github.com/garronej/denoify","commit_stats":{"total_commits":742,"total_committers":21,"mean_commits":"35.333333333333336","dds":"0.37061994609164417","last_synced_commit":"ac6ac4ee0b868b1a4ac6a9da16849723e3bf3f7c"},"previous_names":[],"tags_count":156,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fdenoify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fdenoify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fdenoify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fdenoify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garronej","download_url":"https://codeload.github.com/garronej/denoify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253336862,"owners_count":21892795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","deno","hacktoberfest","jspm","node-builtin","support-deno","sypack"],"created_at":"2024-07-31T02:01:19.505Z","updated_at":"2025-05-14T08:06:18.672Z","avatar_url":"https://github.com/garronej.png","language":"TypeScript","funding_links":["https://github.com/sponsors/garronej"],"categories":["TypeScript","Tools","Uncategorized","源码阅读推荐","deno"],"sub_categories":["Online Playgrounds","Uncategorized","Assistants","独特之处 🦖🦕","XML"],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/6702424/79351107-900eb300-7f38-11ea-8272-91ff725d29f3.png\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ci\u003e🦕 Release on NPM and on deno.land/x with a single codebase🦕\u003c/i\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://github.com/garronej/denoify/actions\"\u003e\n      \u003cimg src=\"https://github.com/garronej/denoify/workflows/ci/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/garronej/denoify/blob/main/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/l/denoify\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.denoify.land\"\u003eHome\u003c/a\u003e\n  -\n  \u003ca href=\"https://docs.denoify.land\"\u003eDocumentation\u003c/a\u003e\n  -\n  \u003ca href=\"https://github.com/garronej/my_dummy_npm_and_deno_module\"\u003eDemo repo\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e **August 2024 Update:** It's now advisable to use [JSR](https://jsr.io/).  \n\u003e JSR, an initiative by the Deno team, addresses a broader set of problems than Denoify.  \n\u003e [Hono](https://hono.dev/), which previously used Denoify, has already migrated to JSR.\n\n# What it is\n\nA 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.\n\n![what_denoify_does](https://user-images.githubusercontent.com/6702424/85449626-41b10c80-b598-11ea-91cc-6805facab1dd.png)\n\n\u003e **NOTE:** Denoify is capable of **recursively** resolving **dependencies**!  \n\u003e It works out of the box with dependencies that uses denoify\n\u003e and there are many option for dealing with dependencies that won't transpile automatically. [See specific documentation](https://github.com/garronej/my_dummy_npm_and_deno_module)\n\nThis 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.\n\n## Deno's Support for NPM Modules: What It Means and the Continued Relevance of Denoify\n\n[Deno now supports NPM modules](https://deno.com/blog/changes#compatibility-with-node-and-npm).  \nThis development significantly benefits NPM module authors as it simplifies the process of integrating their modules into Deno.  \nYou simply instruct your users to import your module using the format: `import {...} from \"npm:your-module@5\";`.\n\nHowever, even with this development, there are still compelling reasons to consider using Denoify for your module:\n\n1. **Publishing on [deno.land/x](https://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.\n\n2. **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.\n\n3. **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`](https://docs.denoify.land/.deno.ts-files)).\n\nTherefore, despite Deno's new NPM support, Denoify continues to offer value in ensuring wider compatibility, adaptability, and visibility for your module.\n\n# Example of modules using Denoify\n\nSome modules that have been made cross-runtime using Denoify:\n\n-   ~[hono](https://github.com/honojs/hono)~ (Migrated to JSR)\n-   [EVT](https://evt.land)\n-   [Nano JSX](https://github.com/nanojsx/nano)\n-   [eta](https://deno.land/x/eta@v1.3.0)\n-   [graphql-helix](https://github.com/contrawork/graphql-helix)\n-   [tsafe](https://github.com/garronej/tsafe)\n-   [Automerge](https://github.com/automerge/automerge)\n-   [...and many others](https://github.com/garronej/denoify/network/dependents?dependent_type=PACKAGE)\n\n# Limitations\n\n-   If your module is vanilla JS it needs to be ported to TypeScript first[^0].\n-   `require()` is not supported.\n-   You can't `fs.readFile()` files that are part of the module ( files inside a `res/`\n    directory for example ). [^1]\n\n[^0]:\n    _Don't be afraid, renaming your source with `.ts` and dropping some `any` here\n    and there will do the trick.\n    You will be able to pull it off even if you aren't familiar with typescript. [Ref](https://github.com/garronej/my_dummy_npm_and_deno_module#enable-strict-mode-and-fixes-errors-if-any)_\n\n[^1]:\n    _In Deno the files that forms your module won’t be pre-fetched and\n    placed in `node_module` like in node so you won’t be able to access files that are not\n    on the disk._\n\n# Get started\n\n[🚀 **Quick start** 🚀](https://docs.denoify.land/)\n\n# Doing without Denoify\n\nIf 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](https://github.com/gvergnaud/ts-pattern/pull/108#issuecomment-1356829719).\n\nPlease 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.\n\n# What's new\n\n**NEW IN v1.6.0**\n\n-   Support for Deno environnement variable (`Deno.env('XYZ')`). Thank you to @dancrumb for this feature. [See issue](https://github.com/garronej/denoify/issues/105)\n\n**NEW IN v1.3.1**\n\n-   Denoify now has [a proper documentation website](https://docs.denoify.land)!\n\n**NEW IN v1.3**\n\n-   Support for `// @denoify-line-ignore` special comment.\n\n**NEW IN v1**\n\n-   `import express from \"express\";` automatically converted into:  \n    `import express from \"npm:express@5\";`  \n    (See [this update](https://deno.com/blog/changes#compatibility-with-node-and-npm))  \n    Most project will now transpile successfully out of the box.\n\n**NEW IN v0.10**\n\n-   Mitigate the risk of comment being accidentally modified.\n-   Possibility to specify output directory in the package.json's denoify field. [See doc](https://github.com/garronej/my_dummy_npm_and_deno_module#optional-step-45-specify-the-output-directory).\n-   Support module augmentation: `declare module ...`. [Example](https://github.com/gcanti/fp-ts/blob/60250b9de118d4939374368ca1be665bac871769/src/Endomorphism.ts#L40)\n-   Possibility to explicitly tell where the `index.ts` is located in the source. [Doc](https://github.com/garronej/my_dummy_npm_and_deno_module#optional-step-475-specify-where-the-indexts-is-located-in-your-source)\n\n**NEW IN v0.9**\n\n-   `tsconfig.json` can be absent if outputDir is specified. [See @zxch3n's PR](https://github.com/garronej/denoify/pull/32)\n-   Enable to configure the name of the output dir. It no longer has to be `deno_dist`. [See @zxch3n's PR](https://github.com/garronej/denoify/pull/31)\n\n**NEW IN v0.7**\n\n-   Support for esm modules. See [issue](https://github.com/garronej/denoify/issues/29). Thanks to [yandeu](https://github.com/yandeu).\n\n**NEW IN v0.7**\n\n-   Support for workspaces where `node_modules` are located in a parent directory.  \n    Thx [@hayes](https://github.com/hayes) [See issue](https://github.com/garronej/denoify/issues/23)\n-   Add basic support for child_process.spawn ([#785](https://github.com/denoland/deno_std/pull/785))\n\n**NEW IN v0.6**\n\n-   Built in support for [graphQL](https://www.npmjs.com/package/graphql).  \n    See how [graphql-helix](https://github.com/contrawork/graphql-helix) got graphql working before `v0.6` using a [custom replacer](https://github.com/contrawork/graphql-helix/blob/79e863288a93d1b491caeca32a4124f97465d5a6/scripts/denoify-replacer.js)\n    referenced in the [`package.json`](https://github.com/contrawork/graphql-helix/blob/79e863288a93d1b491caeca32a4124f97465d5a6/package.json).  \n    You can do the same with other modules using [skypack.dev](https://www.skypack.dev/) or [jspm](https://jspm.org/)\n-   It is now possible to use `console.log()` in custom replacers to help debug.\n-   [Some support](https://github.com/denoland/deno/pull/8191) for `crypto` node builtin.\n\n**NEW IN v0.5** _Breaking changes_\n\n-   All Denoify parameters are now gathered under a uniq `\"denoify\"` field.\n-   Possibility to specify which files should be copied to the `deno_dist` directory (Previously only `README.md` was copied).  \n    [Valid config example](https://github.com/garronej/my_dummy_npm_and_deno_module/blob/master/package.json)\n\n# Introduction video\n\n**NOTE: New features have been introduced since this meeting was hold**\n\n[![Watch the video](https://user-images.githubusercontent.com/6702424/85890466-af09ab00-b7ed-11ea-9cf4-10c9bbfb3621.png)](https://youtu.be/vJQdfTPeeXw)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarronej%2Fdenoify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarronej%2Fdenoify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarronej%2Fdenoify/lists"}