require('process');
just like any other module.
Works in node.js and browsers via the browser.js shim provided with the module.
The goal of this module is not to be a full-fledged alternative to the builtin process module. This module mostly exists to provide the nextTick functionality and little more. We keep this module lean because it will often be included by default by tools like browserify when it detects a module has used the process
global.
It also exposes a "browser" member (i.e. process.browser
) which is true
in this implementation but undefined
in node. This can be used in isomorphic code that adjusts it's behavior depending on which environment it's running in.
If you are looking to provide other process methods, I suggest you monkey patch them onto the process global in your app. A list of user created patches is below.
If you are writing a bundler to package modules for client side use, make sure you use the browser
field hint in package.json.
See https://gist.github.com/4339901 for details.
The browserify module will properly handle this field when bundling your files.
# process ```require('process');``` just like any other module. Works in node.js and browsers via the browser.js shim provided with the module. ## browser implementation The goal of this module is not to be a full-fledged alternative to the builtin process module. This module mostly exists to provide the nextTick functionality and little more. We keep this module lean because it will often be included by default by tools like browserify when it detects a module has used the `process` global. It also exposes a "browser" member (i.e. `process.browser`) which is `true` in this implementation but `undefined` in node. This can be used in isomorphic code that adjusts it's behavior depending on which environment it's running in. If you are looking to provide other process methods, I suggest you monkey patch them onto the process global in your app. A list of user created patches is below. * [hrtime](https://github.com/kumavis/browser-process-hrtime) * [stdout](https://github.com/kumavis/browser-stdout) ## package manager notes If you are writing a bundler to package modules for client side use, make sure you use the ```browser``` field hint in package.json. See https://gist.github.com/4339901 for details. The [browserify](https://github.com/substack/node-browserify) module will properly handle this field when bundling your files.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/javascript/node_modules/process/README.md | |||||
#1 | 18810 | tjuricek |
First-pass at JavaScript client SDK. JavaScript requires Node with Gulp to "browserfy" the library. It's the easiest way I found to use the swagger-js project; bundle up a wrapping method. There is no JavaScript reference guide. The swagger-js doesn't really document what they do very well, actually. Overall I'm not particularly impressed by swagger-js, it was hard to even figure out what the right method syntax was. We may want to invest time in doing it better. This required setting CORS response headers, which are currently defaulted to a fairly insecure setting. |