How to use the rw.dash function in rw

To help you get started, we’ve selected a few rw examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github josephfrazier / prettier-diff / bin / prettier-textconv.js View on Github external
#!/usr/bin/env node

const rw = require('rw').dash
const prettier = require('prettier')
const stringify = require('json-stable-stringify')

// https://github.com/prettier/prettier/tree/a707dda53b13a6956a825609f30baead7ef08a59#api
const prettierOptions = {
  printWidth: 80,
  tabWidth: 2,
  singleQuote: true,
  trailingComma: 'all',
  bracketSpacing: true
}

const content = rw.readFileSync(process.argv[2] || '-').toString()
let pretty = content

// try to format JS files

rw

Now stdin and stdout are files.

BSD-3-Clause
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis