I've collected the gap between Node.js core lib and webpack/browserify's shim lib.
Latest results is in following repository.
Env
- Node.js 10.0.0
- webpack 4.6.0
Gap list
| Node.js |
Browser shim |
Issue |
Link |
| assert |
defunctzombie/commonjs-assert |
Error code and Error message are different |
Issue, Article |
|
|
assert.deepEqual does't support Map, Set, Iterator etc... |
Issue, Document, Release |
|
|
require("assert").strict |
Docs, Release |
| buffer |
feross/buffer |
--- |
|
| child_process |
--- |
--- |
|
| cluster |
--- |
--- |
|
| console |
Raynos/console-browserify |
--- |
|
| constants |
juliangruber/constants-browserify |
--- |
|
| crypto |
crypto-browserify/crypto-browserify |
--- |
|
| dgram |
--- |
--- |
|
| dns |
--- |
--- |
|
| domain |
bevry/domain-browser |
--- |
|
| events |
Gozala/events |
eventNames |
Issue |
|
|
getMaxListeners |
Issue |
|
|
prependListener |
Issue |
|
|
prependOnceListener |
Issue |
|
|
off |
Issue |
| fs |
--- |
--- |
|
| http |
jhiesey/stream-http |
--- |
|
| https |
substack/https-browserify |
--- |
|
| module |
--- |
--- |
|
| net |
--- |
--- |
|
| os |
CoderPuppy/os-browserify |
os.constants |
|
| path |
substack/path-browserify |
path.posix |
Issue |
|
|
path.parse(path) |
Issue |
|
|
path.win32 |
|
|
|
path.format(pathObject) |
|
| process |
shtylman/node-process |
process.channel |
|
|
|
process.platform |
Issue |
|
|
process.execArgv |
Issue |
|
|
process.cpuUsage([previousValue]) |
|
|
|
process.emitWarning(warning[, options]) |
|
| punycode |
bestiejs/punycode.js |
--- |
|
| querystring |
mike-spainhower/querystring |
--- |
|
| readline |
--- |
--- |
|
| repl |
--- |
--- |
|
| stream |
substack/stream-browserify |
--- |
|
| string_decoder |
rvagg/string_decoder |
--- |
Repository |
| sys |
defunctzombie/node-util |
--- |
|
| timers |
jryans/timers-browserify |
--- |
|
| tls |
--- |
--- |
|
| tty |
substack/tty-browserify |
--- |
|
| url |
defunctzombie/node-url |
url.URL(WHATWG URL) |
Release, Document, Issue |
|
|
url.format does't support WHATWG URL |
Release, Document |
| util |
defunctzombie/node-util |
util.callbackify(original) |
|
|
|
util.inspect.custom |
|
|
|
util.inspect.defaultOptions |
|
|
|
util.promisify(original) |
|
|
|
util.promisify.custom |
|
|
|
util.inspect() options maxArrayLength, breakLength |
|
|
|
util.isDeepStrictEqual |
|
| vm |
substack/vm-browserify |
vm.isContext(sandbox) |
|
| zlib |
devongovett/browserify-zlib |
zlib.bytesRead |
|
Tests
Also, I've written the test for these new methods/properties.
Node.js 10 pass the tests, but the code that is bundled by webpack is failed.
May 01
'18 11:05
azu
eventNames, getMaxListeners, prependListener and prependOnceListener are available in [email protected] (https://github.com/webpack/node-libs-browser/pull/74). off will be available in [email protected].
path.posix, path.parse, and parth.format are available in [email protected]
@azu thanks for compiling that list. That will definitely be helpful when updating the libraries 👍
We can't do that too frequently as updating these libraries might be breaking change for a lot of people.
Since node-libs-browser is not active and updated anymore, I’ve taken time and created package which is based on this one but updates it to modern implementation.