Socket
Socket
Sign inDemoInstall

node-libs-browser

Package Overview
Dependencies
85
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-libs-browser

The node core libs for in browser usage.


Version published
Weekly downloads
6M
increased by3.59%
Maintainers
3
Install size
3.64 MB
Created
Weekly downloads
 

Package description

What is node-libs-browser?

The node-libs-browser package is a collection of browser-friendly versions of Node.js core modules. It allows developers to use Node.js-style modules in the browser, providing shims and polyfills for Node.js core modules that do not have direct equivalents in the browser environment. This package is particularly useful for bundling applications with webpack, which uses it to simulate a Node.js environment in the browser.

What are node-libs-browser's main functionalities?

Buffer

Provides a Buffer class that can be used for binary data manipulation in the browser, similar to Node.js's Buffer module.

var Buffer = require('buffer/').Buffer;
var buf = Buffer.from('hello world', 'ascii');
console.log(buf.toString('hex'));

Events

Implements the EventEmitter class to enable event-driven architecture in the browser, mimicking Node.js's events module.

var EventEmitter = require('events/').EventEmitter;
var emitter = new EventEmitter();
emitter.on('event', function(message) {
  console.log(message);
});
emitter.emit('event', 'Hello world!');

Path

Provides utilities for file path operations, similar to Node.js's path module, but adapted for the browser.

var path = require('path-browserify');
console.log(path.basename('/foo/bar/baz/asdf/quux.html'));

Other packages similar to node-libs-browser

Readme

Source

node-libs-browser

The node core libs for in-browser usage.

NOTE: This library is deprecated and won't accept Pull Requests that include Breaking Changes or new Features. Only bugfixes are accepted.

dependencies status

Exports a hash [object] of absolute paths to each lib, keyed by lib names. Modules without browser replacements are null.

Some modules have mocks in the mock directory. These are replacements with minimal functionality.

lib namebrowser implementationmock implementation
assertdefunctzombie/commonjs-assert---
bufferfeross/bufferbuffer.js
child_process------
cluster------
consoleRaynos/console-browserifyconsole.js
constantsjuliangruber/constants-browserify---
cryptocrypto-browserify/crypto-browserify---
dgram------
dns---dns.js
domainbevry/domain-browser---
eventsGozala/events---
fs------
httpjhiesey/stream-http---
httpssubstack/https-browserify---
module------
net---net.js
osCoderPuppy/os-browserify---
pathsubstack/path-browserify---
processshtylman/node-processprocess.js
punycodebestiejs/punycode.js---
querystringmike-spainhower/querystring---
readline------
repl------
streamsubstack/stream-browserify---
string_decoderrvagg/string_decoder---
sysdefunctzombie/node-util---
timersjryans/timers-browserify---
tls---tls.js
ttysubstack/tty-browserifytty.js
urldefunctzombie/node-url---
utildefunctzombie/node-util---
vmsubstack/vm-browserify---
zlibdevongovett/browserify-zlib---

Outdated versions

buffer

The current buffer implementation uses feross/buffer@4.x because feross/buffer@5.x relies on typed arrays. This will be dropped as soon as IE9 is not a typical browser target anymore.

punycode

The current punycode implementation uses bestiejs/punycode.js@1.x because bestiejs/punycode.js@2.x requires modern JS engines that understand const and let. It will be removed someday since it has already been deprecated from the node API.

License

MIT

FAQs

Last updated on 12 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc