airbitz-io-node-js
Advanced tools
Comparing version 0.2.0 to 0.3.0
# airbitz-io-node-js | ||
## 0.3.0 | ||
* Add a `makeNodeContext` function | ||
* Switch to a non-broken version of `disklet` | ||
## 0.2.0 | ||
@@ -4,0 +9,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var airbitzCoreJs = require('airbitz-core-js'); | ||
var crypto = _interopDefault(require('crypto')); | ||
@@ -16,2 +17,7 @@ var disklet = require('disklet'); | ||
/** | ||
* Creates the io resources needed to run the Airbitz core on node.js. | ||
* | ||
* @param {string} path Location where data should be written to disk. | ||
*/ | ||
function makeNodeIo (path) { | ||
@@ -26,3 +32,18 @@ return { | ||
/** | ||
* Creates an Airbitz context for use on node.js. | ||
* | ||
* @param {{ path?: string }} opts Options for creating the context, | ||
* including the `path` where data should be written to disk. | ||
*/ | ||
function makeNodeContext (opts) { | ||
if ( opts === void 0 ) opts = {}; | ||
var path = opts.path; if ( path === void 0 ) path = './airbitz'; | ||
opts.io = makeNodeIo(path); | ||
return airbitzCoreJs.makeContext(opts) | ||
} | ||
exports.makeNodeIo = makeNodeIo; | ||
exports.makeNodeContext = makeNodeContext; | ||
//# sourceMappingURL=airbitz-io-node-js.cjs.js.map |
@@ -0,1 +1,2 @@ | ||
import { makeContext } from 'airbitz-core-js'; | ||
import crypto from 'crypto'; | ||
@@ -9,2 +10,7 @@ import { makeNodeFolder } from 'disklet'; | ||
/** | ||
* Creates the io resources needed to run the Airbitz core on node.js. | ||
* | ||
* @param {string} path Location where data should be written to disk. | ||
*/ | ||
function makeNodeIo (path) { | ||
@@ -19,3 +25,17 @@ return { | ||
export { makeNodeIo }; | ||
/** | ||
* Creates an Airbitz context for use on node.js. | ||
* | ||
* @param {{ path?: string }} opts Options for creating the context, | ||
* including the `path` where data should be written to disk. | ||
*/ | ||
function makeNodeContext (opts) { | ||
if ( opts === void 0 ) opts = {}; | ||
var path = opts.path; if ( path === void 0 ) path = './airbitz'; | ||
opts.io = makeNodeIo(path); | ||
return makeContext(opts) | ||
} | ||
export { makeNodeIo, makeNodeContext }; | ||
//# sourceMappingURL=airbitz-io-node-js.es6.js.map |
{ | ||
"name": "airbitz-io-node-js", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "IO dependencies for running airbitz-core-js on node.js", | ||
"url": "https://airbitz.co", | ||
"homepage": "https://airbitz.co", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"author": "Airbitz, Inc.", | ||
@@ -10,18 +11,7 @@ "contributors": [ | ||
], | ||
"license": "SEE LICENSE IN LICENSE", | ||
"main": "lib/airbitz-io-node-js.cjs.js", | ||
"module": "lib/airbitz-io-node-js.es6.js", | ||
"dependencies": { | ||
"disklet": "^0.1.1", | ||
"node-fetch": "^1.6.3" | ||
}, | ||
"devDependencies": { | ||
"husky": "^0.13.3", | ||
"rollup": "^0.41.6", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"standard": "^10.0.1" | ||
}, | ||
"files": [ | ||
"lib/*" | ||
], | ||
"main": "lib/airbitz-io-node-js.cjs.js", | ||
"module": "lib/airbitz-io-node-js.es6.js", | ||
"repository": { | ||
@@ -33,6 +23,19 @@ "type": "git", | ||
"build": "rollup -c", | ||
"precommit": "npm run lint", | ||
"lint": "standard '*.js' 'src/**/*.js'", | ||
"precommit": "npm run lint", | ||
"prepublish": "npm run lint && npm run build" | ||
}, | ||
"dependencies": { | ||
"disklet": "^0.1.2", | ||
"node-fetch": "^1.6.3" | ||
}, | ||
"devDependencies": { | ||
"husky": "^0.13.3", | ||
"rollup": "^0.43.0", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"standard": "^10.0.1" | ||
}, | ||
"peerDependencies": { | ||
"airbitz-core-js": "^0.3.1" | ||
} | ||
} |
@@ -7,13 +7,14 @@ # Airbitz Node.js IO depdendencies | ||
```js | ||
import { makeContext } from 'airbitz-core-js' | ||
import { makeNodeIo } from 'airbitz-io-node-js' | ||
```javascript | ||
import { makeNodeContext } from 'airbitz-io-node-js' | ||
const context = makeContext({ | ||
const context = makeNodeContext({ | ||
apiKey: '...', | ||
appId: '...', | ||
io: makeNodeIo('/path/for/saving/data') | ||
path: '/path/for/saving/data' | ||
}) | ||
``` | ||
The Airbitz core will save all login data under the provided path. | ||
The Airbitz core will save all login data under the provided `path` option. | ||
There is also a standalone `makeNodeIo(path: string)` function if you would like to inspect or modify the `io` object before passing it to the core's `makeContext` function. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
8451
72
20
3
+ Added@babel/runtime@7.26.0(transitive)
+ Addedaes-js@3.1.2(transitive)
+ Addedairbitz-core-js@0.3.6(transitive)
+ Addedbase-x@1.1.0(transitive)
+ Addedbn.js@4.12.1(transitive)
+ Addedbrorand@1.1.0(transitive)
+ Addedelliptic@6.6.1(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedhmac-drbg@1.0.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash-es@4.17.21(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimalistic-crypto-utils@1.0.1(transitive)
+ Addedredux@3.7.24.2.1(transitive)
+ Addedredux-thunk@2.4.2(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedscrypt-js@2.0.4(transitive)
+ Addedsymbol-observable@1.2.0(transitive)
+ Addedutf8@2.1.2(transitive)
Updateddisklet@^0.1.2