1.0.0 • Published 5 years ago

namespace-polyfill v1.0.0

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
5 years ago

NameSpace Polyfill

Use tomorrow's namespaces today!

What is this?

We are currently discussing making a namespace in Node.js.

There is a debate regarding the best mechanism to do so. Currently there are two major approaches:

  • using a url like scheme such as nodejs:${builtin}
  • using a scope such as @nodejs/${builtin}

One of the critiques against the url like scheme is that it would not be easy to polyfill. This project serves as a proof of concept that we will be able to polyfill any approach to namespaces, making polyfilling a non-issue for reaching consesnsus in Node.js core.

Installing

npm install --save namespace-polyfill

Using

node -r namespace-polyfill your-entry-point.js

Now what?

You can start using the nodejs: namespace

const fs = require('nodejs:fs');