npm

Need private packages and team management tools?Check out npm Orgs. »

safe-write

0.2.3 • Public • Published

node-safe-write Build Status

Store and get files width file locker. It is safe in mulit process.

Usage

var safeWrite = require('safe-write')
 
safeWrite.write('./file.json', 'newContent', 'oldContent', function(err) {});
 
safeWrite.read('./file2.json', function(err, content) {});

Methods

safeWrite.write(file, newContent[, oldContent][, callback][, ignoreUnlockErr])

write file width file lock.

return Promise Object.

safeWrite.fastWrite(file, newContent[, oldContent][, callback])

wirte file widthout file lock.

return Promise Object.

safeWrite.read(file[, callback][, ignoreUnlockErr])

read file with file lock.

return Promise Object.

Options

See lockfile

install

npm i safe-write

Downloadsweekly downloads

3

version

0.2.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability