JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 710
  • Score
    100M100P100Q103891F
  • License MIT

shortcut to fs.writeFile

Package Exports

  • write-file-utf8

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (write-file-utf8) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

write-file-utf8

shortcut to fs.writeFile

Usage

var write = require('write-file-utf8')

var filePath = '/tmp/foo'
var content = 'bar'

write(filePath, content)

Actually is the same as

var fs = require('fs')

var filePath = '/tmp/foo'
var content = 'bar'

function throwError (err) {
  if (err) {
    throw err
  }
}

fs.writeFile(filePath, content, 'utf8', throwError)