GithubHelp home page GithubHelp logo

http-node's Introduction

http-node

This module is a standalone package of http from Node.js v6.3.0. Unlike http-browserify, this is not a shim but the original code of Node.js, so it requires the net module. This is useful for having the Node.js core APIs on JavaScript platforms other than Node.js, where TCP sockets are available (which can be wrapped in a net module). One example of this is Chrome Apps with chrome-net.

install / usage with browserify

npm install http-node

To use it with browserify, you have to use the JS API of browserify; the command line API does not support changing builtins.

Example:

const browserify = require('browserify');

const builtins = require('browserify/lib/builtins.js');
var customBuiltins = Object.assign({}, builtins);
customBuiltins.http = require.resolve('http-node');

var b = browserify({builtins: customBuiltins});

b.add(...

differences to original Node.js code

  • require calls of _http_* modules prefixed with ./
  • require('internal/util').deprecate replaced by require('util').deprecate
  • uses http-parser-js
  • commented out calls to DTRACE_HTTP_*, LTTNG_HTTP_* and COUNTER_HTTP_*
  • does not presume that sockets have a _handle

credit

The code is taken from the Node.js project:

Copyright Node.js contributors. All rights reserved.

license

MIT

http-node's People

Contributors

alxhotel avatar feross avatar jscissr avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  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.