Sha256: 7ecf48cdd9f4819256be92ce4f60fb61e9fc92a2cc396dae4f7ca15e050779eb

Contents?: true

Size: 390 Bytes

Versions: 7

Compression:

Stored size: 390 Bytes

Contents

const { spawnSync } = require("child_process");
const path = require("path");

module.exports = (text, _parsers, _opts) => {
  const child = spawnSync("ruby", [path.join(__dirname, "./ripper.rb")], {
    input: text
  });

  const error = child.stderr.toString();
  if (error) {
    throw new Error(error);
  }

  const response = child.stdout.toString();
  return JSON.parse(response);
};

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
prettier-0.16.0 src/parse.js
prettier-0.15.1 src/parse.js
prettier-0.15.0 src/parse.js
prettier-0.14.0 src/parse.js
prettier-0.13.0 src/parse.js
prettier-0.12.3 src/parse.js
prettier-0.12.2 src/parse.js