New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

filerw

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filerw

A node-task compliant read-write interface for local filesystems.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

node-filerw

A node-task compliant read-write interface for local filesystems.

API

read(path, options)

Read a file from the local disk and return a promise which resolves to a node-task compliant record.

The options object supports these keys:

  • encoding The encoding of the file to be read.
var filerw = require('filerw');
filerw.read('test/fixtures/foo.txt', { encoding: 'utf8' }).then(function (self) {
  console.log(self.toString()) // 'foo'
});

write(buffer, options)

Save a node-task compliant buffer to the local disk.

The options object supports these keys: n/a

var filerw = require('./lib/filerw');
var file = new Record('tmp/test.txt', 'utf8', 'test file');
filerw.write(file).then(function(self) {
  console.log(self); // file
});

Keywords

node-task

FAQs

Package last updated on 13 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts