111 lines
9.8 KiB
JSON
111 lines
9.8 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "any-promise@^1.0.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "any-promise",
|
||
|
"name": "any-promise",
|
||
|
"rawSpec": "^1.0.0",
|
||
|
"spec": ">=1.0.0 <2.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/mz"
|
||
|
]
|
||
|
],
|
||
|
"_from": "any-promise@>=1.0.0 <2.0.0",
|
||
|
"_id": "any-promise@1.3.0",
|
||
|
"_inCache": true,
|
||
|
"_location": "/any-promise",
|
||
|
"_nodeVersion": "6.0.0",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "packages-16-east.internal.npmjs.com",
|
||
|
"tmp": "tmp/any-promise-1.3.0.tgz_1462709704988_0.08345960266888142"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "kevinbeaty",
|
||
|
"email": "kevin@simplectic.com"
|
||
|
},
|
||
|
"_npmVersion": "3.8.6",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "any-promise@^1.0.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "any-promise",
|
||
|
"name": "any-promise",
|
||
|
"rawSpec": "^1.0.0",
|
||
|
"spec": ">=1.0.0 <2.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/mz",
|
||
|
"/probe-image-size",
|
||
|
"/thenify"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
|
||
|
"_shasum": "abc6afeedcea52e809cdc0376aed3ce39635d17f",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "any-promise@^1.0.0",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/mz",
|
||
|
"author": {
|
||
|
"name": "Kevin Beaty"
|
||
|
},
|
||
|
"browser": {
|
||
|
"./register.js": "./register-shim.js"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/kevinbeaty/any-promise/issues"
|
||
|
},
|
||
|
"dependencies": {},
|
||
|
"description": "Resolve any installed ES6 compatible promise",
|
||
|
"devDependencies": {
|
||
|
"ava": "^0.14.0",
|
||
|
"bluebird": "^3.0.0",
|
||
|
"es6-promise": "^3.0.0",
|
||
|
"is-promise": "^2.0.0",
|
||
|
"lie": "^3.0.0",
|
||
|
"mocha": "^2.0.0",
|
||
|
"native-promise-only": "^0.8.0",
|
||
|
"phantomjs-prebuilt": "^2.0.0",
|
||
|
"pinkie": "^2.0.0",
|
||
|
"promise": "^7.0.0",
|
||
|
"q": "^1.0.0",
|
||
|
"rsvp": "^3.0.0",
|
||
|
"vow": "^0.4.0",
|
||
|
"when": "^3.0.0",
|
||
|
"zuul": "^3.0.0"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"shasum": "abc6afeedcea52e809cdc0376aed3ce39635d17f",
|
||
|
"tarball": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz"
|
||
|
},
|
||
|
"gitHead": "39a1034e7345ca5f0f0a2e6cc82f3bf8e308b2cc",
|
||
|
"homepage": "http://github.com/kevinbeaty/any-promise",
|
||
|
"keywords": [
|
||
|
"promise",
|
||
|
"es6"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"main": "index.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "kevinbeaty",
|
||
|
"email": "kevin@simplectic.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "any-promise",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "## Any Promise\n\n[![Build Status](https://secure.travis-ci.org/kevinbeaty/any-promise.svg)](http://travis-ci.org/kevinbeaty/any-promise)\n\nLet your library support any ES 2015 (ES6) compatible `Promise` and leave the choice to application authors. The application can *optionally* register its preferred `Promise` implementation and it will be exported when requiring `any-promise` from library code.\n\nIf no preference is registered, defaults to the global `Promise` for newer Node.js versions. The browser version defaults to the window `Promise`, so polyfill or register as necessary.\n\n### Usage with global Promise:\n\nAssuming the global `Promise` is the desired implementation:\n\n```bash\n# Install any libraries depending on any-promise\n$ npm install mz\n```\n\nThe installed libraries will use global Promise by default.\n\n```js\n// in library\nvar Promise = require('any-promise') // the global Promise\n\nfunction promiseReturningFunction(){\n return new Promise(function(resolve, reject){...})\n}\n```\n\n### Usage with registration:\n\nAssuming `bluebird` is the desired Promise implementation:\n\n```bash\n# Install preferred promise library\n$ npm install bluebird\n# Install any-promise to allow registration\n$ npm install any-promise\n# Install any libraries you would like to use depending on any-promise\n$ npm install mz\n```\n\nRegister your preference in the application entry point before any other `require` of packages that load `any-promise`:\n\n```javascript\n// top of application index.js or other entry point\nrequire('any-promise/register/bluebird')\n\n// -or- Equivalent to above, but allows customization of Promise library\nrequire('any-promise/register')('bluebird', {Promise: require('bluebird')})\n```\n\nNow that the implementation is registered, you can use any package depending on `any-promise`:\n\n\n```javascript\nvar fsp = require('mz/fs') // mz/fs will use registered bluebird promises\nvar Promise = require('any-promise') // the registered bluebird promise \n```\n\nIt is safe to call `register` multiple times, but it must always be with the same implementation.\n\nAgain, registration is *optional*. It should only be called by the application user if overriding the global `Promise` implementation is desired.\n\n### Optional Application Registration\n\nAs an application author, you can *optionally* register a preferred `Promise` implementation on application startup (before any call to `require('any-promise')`:\n\nYou must register your preference before any call to `require('any-promise')` (by you or required packages), and only one implementation can be registered. Typically, this registration would occur at the top of the application entry point.\n\n\n#### Registration shortcuts\n\nIf you are using a known `Promise` implementation, you can register your preference with a shortcut:\n\n\n```js\nrequire('any-promise/register/bluebird')\n// -or-\nimport 'any-promise/register/q';\n```\n\nShortcut registration is the preferred registration method as it works in the browser and Node.js. It is also convenient for using with `import` and many test runners, that offer a `--require` flag:\n\n```\n$ ava --require=any-promise/register/bluebird test.js\n```\n\nCurrent known implementations include `bluebird`, `q`, `when`, `rsvp`, `es6-promise`, `promise`, `native-promise-only`, `pinkie`, `vow` and `lie`. If you are not using a known implementation, you can use another registration method described below.\n\n\n#### Basic Registration\n\nAs an alternative to registration shortcuts, you can call the `register` function with the preferred `Promise` implementation. The benefit of this approach is that a `Promise` library can be required by name without being a known implementation. This approach does NOT work in the browser. To use `any-promise` in the browser use either registration shortcuts or specify the `Promise` constructor using advanced registration (see below).\n\n```javascript\nrequire('any-promise/register')('when')\n// -or- require('any-promise/register')('any other ES6 compatible libra
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/kevinbeaty/any-promise.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"test": "ava"
|
||
|
},
|
||
|
"typings": "index.d.ts",
|
||
|
"version": "1.3.0"
|
||
|
}
|