项目原始demo,不改动
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

1234567891011
  1. 'use strict';
  2. const path = require('path');
  3. const fs = require('graceful-fs');
  4. const stripBom = require('strip-bom');
  5. const parseJson = require('parse-json');
  6. const pify = require('pify');
  7. const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp));
  8. module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp));
  9. module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp);