1.0.32 • Published 4 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
4 years ago
1.0.31
4 years ago
1.0.30
5 years ago
1.0.29
5 years ago
1.0.27
5 years ago
1.0.26
5 years ago
1.0.25
5 years ago
1.0.24
5 years ago
1.0.23
5 years ago
1.0.22
5 years ago
1.0.21
5 years ago
1.0.20
5 years ago
1.0.19
5 years ago
1.0.18
5 years ago
1.0.17
5 years ago
1.0.16
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago