How to use the fs-jetpack.read function in fs-jetpack

To help you get started, we’ve selected a few fs-jetpack 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 NREL / OpenStudio-PAT / tasks / build.js View on Github external
var argv = require('yargs').argv;

let destination = path.join(conf.paths.dist, '..', 'depend');
let dependencies = ['openstudio', 'energyplus', 'ruby', 'mongo', 'openstudioServer'];

if (argv.prefix) {
  destination = argv.prefix;
}

if (argv.exclude) {
  const without = argv.exclude.split(',');
  dependencies = _.difference(dependencies, without);
}

const manifest = jetpack.read('manifest.json', 'json');

const platform = os.platform();
const arch = os.arch();

gulp.task('download-deps', function () {

  // List the dependencies to download here
  // These should correspond to keys in the manifest

  console.log('Dependencies: ' + dependencies.sort().join(', '));
  var tasks = dependencies.map(depend => {
    const fileInfo = _.find(manifest[depend], {platform: platform});
    const fileName = fileInfo.name;

    return progress(request({uri: manifest.endpoint + fileName, timeout: 5000}))
      .on('progress', state => {
github hello-efficiency-inc / raven-reader / static / electron_boilerplate / env_config.js View on Github external
(function () {
    var jetpack = require('fs-jetpack');
    if (typeof window === 'object') {
        // Web browser context, __dirname points to folder where app.html file is.
        window.env = jetpack.read(__dirname + '/env_config.json', 'json');
    } else {
        // Node context
        module.exports = jetpack.read(__dirname + '/../../env_config.json', 'json');
    }
}());
github Flaque / penguin / src / components / app.js View on Github external
_.values(ev.dataTransfer.files).forEach(({path}) => {
      if (!isSVG(path)) throw "Path is not svg!"

      let string = jetpack.read(path)

      // Change color
      let svg = SVG.parse(string)
      let markup = SVG.coloredMarkup(svg, this.state.color)

      this.setState((prevState) => {
        prevState.svgs[path] = {original: svg, current: markup}
        return prevState
      })
    })
github szwacz / nw-boilerplate / app / vendor / nw-boilerplate / env_config.js View on Github external
(function () {
    var jetpack = require('fs-jetpack');
    if (typeof window === 'object') {
        // Web browser context
        window.env = jetpack.read('env_config.json', 'json');
    } else {
        // Node context
        module.exports = jetpack.read(__dirname + '/../../env_config.json', 'json');
    }
}());
github zumwald / oss-attribution-generator / index.js View on Github external
.then((licenseInfos) => {
        var attributionSequence = _(licenseInfos).filter(licenseInfo => {
            return !licenseInfo.ignore && licenseInfo.name != undefined;
        }).sortBy(licenseInfo => {
            return licenseInfo.name.toLowerCase();
        }).map(licenseInfo => {
            return [licenseInfo.name,`${licenseInfo.version} <${licenseInfo.url}>`,
                    licenseInfo.licenseText || `license: ${licenseInfo.license}${os.EOL}authors: ${licenseInfo.authors}`].join(os.EOL);
        }).value();

        var attribution = attributionSequence.join(`${os.EOL}${os.EOL}******************************${os.EOL}${os.EOL}`);

        var headerPath = path.join(options.outputDir, 'header.txt');
        
        if (jetpack.exists(headerPath)) {
            var template = jetpack.read(headerPath);
            console.log('using template', template);
            attribution = template + os.EOL + os.EOL + attribution;
        }

        jetpack.write(path.join(options.outputDir, 'licenseInfos.json'), JSON.stringify(licenseInfos));

        return jetpack.write(path.join(options.outputDir, 'attribution.txt'), attribution);
    })
    .catch(e => {
github etherisc / tokensale / bin / select-resources.js View on Github external
function main() {

    try {

        const { migrations, test, } = yaml.safeLoad(fs.read('resources.yml'));

        selectResources('migrations', migrations);
        selectResources('test', test);

    } catch (e) {

        log.error(e);

    }

}
github hello-efficiency-inc / raven-reader / app / components / Main.vue View on Github external
return service.fetchOne(id).then(function(item){
        var data = jetpack.read(useDataDir.path(item.file))
        self.id = item._id
        self.articletitle = item.title;
        self.author = item.author;
        self.favicon = item.favicon;
        self.feed = item.feed;
        self.feed_id = item.feed_id;
        self.pubDate = moment.unix(item.pubDate).format("MMMM Do YYYY");
        self.link = item.link;
        if(!item.read){
            self.markedread = true
            markRead(id)
            decrementCount(item.feed_id)
        } else {
          self.markedread = item.read
        }
        read(data,function(err,article,res){
github NREL / OpenStudio-PAT / tasks / utils.js View on Github external
module.exports.getElectronVersion = function () {
  var manifest = jetpack.read(__dirname + '/../package.json', 'json');
  return manifest.devDependencies['electron'].substring(1);
};
github dempfi / ayu / gulpfile.js View on Github external
    .map(p => fs.read(p, 'utf8'))
    .map(_.template)