rw-utf8-promise

1.0.1 • Public • Published

Installation

npm i --save rw-utf8-promise

Usage

Read a file:

const rw = require('rw-utf8-promise')

var file_path = '/etc/hostname'

rw.read(file_path)
.then(function (hostname) {
  console.log(hostname)
})
.catch(function (err) {
  console.log(err)
})

Write to a file:

const rw = require('rw-utf8-promise')

var file_path = '/etc/hostname'
var new_hostname = 'archlinux-guy'

rw.write(file_path, new_hostname)
.then(function (hostname) {
  console.log(hostname)
})
.catch(function (err) {
  console.log(err)
})

License

MIT License

/rw-utf8-promise/

    Package Sidebar

    Install

    npm i rw-utf8-promise

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    2.83 kB

    Total Files

    4

    Last publish

    Collaborators

    • adonesp