npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

denoify

v1.6.16

Published

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

Downloads

5,240

Readme

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.

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 first[^0].
  • require() is not supported.
  • You can't fs.readFile() files that are part of the module ( files inside a res/ directory for example ). [^1]

[^0]: 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

[^1]: 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.

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

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