GithubHelp home page GithubHelp logo

sunbox / node-browser-builtins Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexgorbatchev/node-browser-builtins

0.0 2.0 0.0 612 KB

Browser altenatives to built-in node.js modules

License: MIT License

JavaScript 100.00%

node-browser-builtins's Introduction

Browser altenatives to built-in node.js modules

This is used by browserify module. Initially these files were in node-browser-resolve but disappeared in v1.0.1 which broke browserify dependency. This module is that missing dependency.

Dependency status Build status

Browser support

  • Safari: latest
  • Chrome: latest
  • Firefox: latest
  • Opera: latest
  • Internet Explore: 10, 11

Legacy browsers

This decision behind not supporting legacy browsers was made to reduce the maintenance and allow usage of more advanced browser features such as TypedArrays. Please do not supply pull requests there adds support for legacy browsers. Instead we recommend that you use the necessary polyfills for legacy browser support. Should you be willing to start your own complete browser-builtins polyfills project, then feel free to contact us for tips and hints.

Documentation

Requireing this module gives you a simple map between the modulename and a filepath to the module containing the shim. You can then point to these files in your pseudo-node implementation. Note that beyond the nodecore modules there is also a process module, there mimics global.process in node.

require('browser-builtins');
{
  assert: '/user/node_modules/browser-builtins/builtin/assert.js',
  child_process: '/user/node_modules/browser-builtins/builtin/child_process.js',
  cluster: '/user/node_modules/browser-builtins/builtin/cluster.js',
  dgram: '/user/node_modules/browser-builtins/builtin/dgram.js',
  dns: '/user/node_modules/browser-builtins/builtin/dns.js',
  domain: '/user/node_modules/browser-builtins/builtin/domain.js',
  events: '/user/node_modules/browser-builtins/builtin/events.js',
  fs: '/user/node_modules/browser-builtins/builtin/fs.js',
  https: '/user/node_modules/browser-builtins/builtin/https.js',
  net: '/user/node_modules/browser-builtins/builtin/net.js',
  path: '/user/node_modules/browser-builtins/builtin/path.js',
  process: '/user/node_modules/browser-builtins/builtin/process.js',
  querystring: '/user/node_modules/browser-builtins/builtin/querystring.js',
  readline: '/user/node_modules/browser-builtins/builtin/readline.js',
  repl: '/user/node_modules/browser-builtins/builtin/repl.js',
  stream: '/user/node_modules/browser-builtins/builtin/stream.js',
  string_decoder: '/user/node_modules/browser-builtins/builtin/string_decoder.js',
  sys: '/user/node_modules/browser-builtins/builtin/sys.js',
  timers: '/user/node_modules/browser-builtins/builtin/timers.js',
  tls: '/user/node_modules/browser-builtins/builtin/tls.js',
  tty: '/user/node_modules/browser-builtins/builtin/tty.js',
  url: '/user/node_modules/browser-builtins/builtin/url.js',
  util: '/user/node_modules/browser-builtins/builtin/util.js',
  punycode: '/user/node_modules/browser-builtins/node_modules/punycode/punycode.js',
  http: '/user/node_modules/browser-builtins/node_modules/http-browserify/index.js',
  vm: '/user/node_modules/browser-builtins/node_modules/vm-browserify/index.js',
  crypto: '/user/node_modules/browser-builtins/node_modules/crypto-browserify/index.js',
  console: '/user/node_modules/browser-builtins/node_modules/console-browserify/index.js',
  zlib: '/user/node_modules/browser-builtins/node_modules/zlib-browserify/index.js',
  buffer: '/user/node_modules/browser-builtins/node_modules/buffer/index.js',
  constants: '/user/node_modules/browser-builtins/node_modules/constants-browserify/constants.json',
  os: '/user/node_modules/browser-builtins/node_modules/os-browserify/browser.js'
}

Contribute

When fixing a bug please check the following:

  1. Check that the bug do not exist in node and fix it there first
  2. Check that updating the code from the node source dosn't fix it
  3. It must be a browser issue, fix it here. But do please link to the browser bug report

Testing

node-browser-builtins uses zuul for client side testing. In summary, all you will need is a Saucelabs account (free one will work just fine). To get up and running with it, please follow zuul instructions.

Finally, just run:

npm test

History

  1. "Forked" from node-browser-resolve, originally written by Roman Shtylman (@shtylman).
  2. Major update to node v0.10 and tests (@AndreasMadsen)
  3. no legacy browser support (IE10+)

node-browser-builtins's People

Contributors

alexgorbatchev avatar andersekdahl avatar andreasmadsen avatar aredridel avatar coderpuppy avatar danyapostfactum avatar defunctzombie avatar feross avatar jaredhanson avatar juliangruber avatar kumavis avatar legastero avatar pmuellr avatar raynos avatar tellnes avatar vicapow avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.