This library is now archived due to
deno.nsreproducing its behavior completely anddeno.nswill be used indeno2nodewhich is what I was planning on making after I finished this project. Go check out those projects instead🙂
A zero-dependency Node.js implementation of the Deno Runtime APIs.
This library is currently under development and its API is subject to change with most of the tests still unimplemented.
const { Deno } = require("node-deno");
console.log(Deno.build.os);If you would like to use node-deno to polyfill Deno into your plain JS projects to be ran on either runtime, then just include the following code at the top of your scripts:
!globalThis.Deno && (global.Deno = require(".").Deno);-
npm install -
npm run dev -
Change any of the files and watch your changes rebuild.
Personally, I like to create a dev.js file with the following code to test out my changes and then run them using node dev:
const { Deno } = require("node-deno");
(async () => {
console.log(Deno); // check if it's working
})();To test the project using Jest, simply run the following command in your terminal:
npm test-
Deno.build.os: Can be all of the supported operating systems supported by Node.js instead of just"windows" | "linux" | "darwin". This shouldn't really affect that much code at all. -
Deno.permissions: All permissions are always going to begranted. To prevent errors, the methods that request changes always return the status that the call was asking for but it does not actually mean that permission is revoked in any way (i.e.Deno.permissions.revoke({ name: "env" })returnstrue). -
Follow the specification as closely as possible.
-
Resource Management
-
Using Executables (i.e.
Deno.runandDeno.kill) -
Reproduce
Deno.testAPI (notdeno_std/testing) -
Stable and Unstable versions of Deno runtime.
-
Releasing
node-denoversions for at least every single major release ofdeno. -
// TODO: add some more
-
Reproducing
Deno.permissionsbehavior and other methods such as (Deno.env) on runtime. -
Having
node-denoverions for every single minordenorelease. -
// TODO: add some more