1.0.32 • Published 6 years ago
ps-file v1.0.32
ps-file
package used to simplify your writing or reading file
install
npm i ps-file@latest
import
let psfile = require('ps-file');
usage
1,read file
let psfile = require('ps-file'),
pathLib = require('path'),
workpath = process.cwd();
psfile(pathLib.resolve(workpath, './file'))
.read()
.then(content => {
console.log(content);
})
2,write file
let psfile = require('ps-file'),
pathLib = require('path'),
workpath = process.cwd();
psfile(pathLib.resolve(workpath, './file'))
.write('hello worlk')
.then(node => {
console.log('success');
})
3,load file contents of current folder recusively.
let psfile = require('ps-file'),
pathLib = require('path'),
workpath = process.cwd();
psfile(pathLib.resolve(workpath, './file'))
.children((node) => true)
.then(nodes => {
return new Promise(nodes.map( node => {
return node.read()
}))
}).then(contents => {
console.log(contents);
})
1.0.32
6 years ago
1.0.31
6 years ago
1.0.30
6 years ago
1.0.29
6 years ago
1.0.27
6 years ago
1.0.26
6 years ago
1.0.25
6 years ago
1.0.24
6 years ago
1.0.23
6 years ago
1.0.22
6 years ago
1.0.21
6 years ago
1.0.20
6 years ago
1.0.19
6 years ago
1.0.18
6 years ago
1.0.17
6 years ago
1.0.16
6 years ago
1.0.15
6 years ago
1.0.14
6 years ago
1.0.13
6 years ago
1.0.12
6 years ago
1.0.11
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago