fs.promiser
Advanced tools
Comparing version 1.0.6 to 1.0.7
'use strict'; | ||
const fs = require('fs'); | ||
const Module = require('module'); | ||
const promisify = require('./promisify'); | ||
class fsPromiser{ | ||
static _get(){ | ||
return promisify(fs); | ||
class fsPromiser { | ||
static _get() { | ||
return promisify(fs); | ||
} | ||
} | ||
module.exports = fsPromiser._get(); |
{ | ||
"name": "fs.promiser", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Promise wrapper on top of fs module", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "node_modules/gulp/bin/gulp.js test", | ||
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls" | ||
}, | ||
@@ -20,14 +21,14 @@ "repository": { | ||
"fs", | ||
"file system", | ||
"bluebird", | ||
"fs.promiser", | ||
"fs-promisified", | ||
"fs-promisify", | ||
"fs-promise", | ||
"fs.promised.", | ||
"fs-promised", | ||
"bluebird", | ||
"fs-promise", | ||
"fs.promise", | ||
"fs.promises", | ||
"fs" | ||
"fs.promises" | ||
], | ||
"dependencies": { | ||
"bluebird": "^3.5.1" | ||
}, | ||
"homepage": "https://github.com/void666/fs.promise#readme", | ||
@@ -45,3 +46,4 @@ "devDependencies": { | ||
"mocha": "^5.0.4", | ||
"yargs": "^8.0.2" | ||
"yargs": "^8.0.2", | ||
"nodemon": "*" | ||
}, | ||
@@ -48,0 +50,0 @@ "engines": { |
'use strict'; | ||
const util = require('util'); | ||
const promisify = (module) => { | ||
const promisify = module => { | ||
return new Proxy(module, { | ||
@@ -7,0 +6,0 @@ get: (moduleName, functionName) => { |
@@ -1,2 +0,28 @@ | ||
# fs.promise | ||
Promise wrapper on top of fs module | ||
# fs.promiser | ||
####[npm : fs.promiser](https://www.npmjs.com/package/fs.promiser) | ||
[![npm version](https://badge.fury.io/js/fs.promiser.svg)](https://badge.fury.io/js/fs.promiser) | ||
[![coverage status](https://coveralls.io/repos/github/void666/fs.promiser/badge.svg)](https://coveralls.io/github/void666/fs.promiser) | ||
[![build status](https://travis-ci.org/void666/fs.promiser.svg?branch=master)](https://travis-ci.org/void666/fs.promiser) | ||
[![npm downloads](https://img.shields.io/npm/dt/fs.promiser.svg)](https://img.shields.io/npm/dt/fs.promiser) | ||
Minimal promise wrapper on top of fs module. | ||
#### Usage | ||
`Note : node version >= 8.10` | ||
``` | ||
fs.readFile('/path/to/file.txt', options) | ||
.then((data) => { | ||
... //Do Something | ||
}) | ||
.catch((err) => { | ||
console.log('Error', err); | ||
}) | ||
``` | ||
### Installation | ||
`npm install fs.promiser` | ||
### Test | ||
`npm test` |
@@ -7,3 +7,3 @@ 'use strict'; | ||
return fs.readFile('test.json') | ||
.then((data) => { | ||
.then(data => { | ||
const parsedJson = JSON.parse(data); | ||
@@ -13,10 +13,10 @@ expect(parsedJson.code).equal('fs.promiser'); | ||
}) | ||
.catch((err) =>{ | ||
.catch(err => { | ||
console.log('Error', err); | ||
}) | ||
}); | ||
}); | ||
it('should be able to get the constants from FS, which is a non function', () => { | ||
const R_OK = fs.R_OK; | ||
expect(typeof R_OK).not.equal('Function'); | ||
}) | ||
const R_OK = fs.R_OK; | ||
expect(typeof R_OK).not.equal('Function'); | ||
}); | ||
}); |
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
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
20594
0
0
28
1
12
129
- Removedbluebird@^3.5.1
- Removedbluebird@3.7.2(transitive)