Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-libs-browser

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-libs-browser

The node core libs for in browser usage.

  • 0.5.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2M
decreased by-57.42%
Maintainers
1
Weekly downloads
 
Created

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

FAQs

Package last updated on 21 May 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc