Socket
Socket
Sign inDemoInstall

fs.promiser

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6 to 1.0.7

8

index.js
'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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc