Sha256: 6000324a5f06ac4ad5edbb8792c1927c1c3fad48559a09629ad420277006f9a8
Contents?: true
Size: 671 Bytes
Versions: 30
Compression:
Stored size: 671 Bytes
Contents
#!/usr/bin/env node 'use strict'; let fs = require('fs'); let buildify = require('buildify'); let rimraf = require('rimraf'); let path = 'resources/js'; if (fs.statSync(path).isDirectory()) { rimraf.sync(path); console.log('Removed existing resources/js files.'); } fs.mkdirSync(path); console.log('Created resources/js'); let files = fs.readdirSync('resources/json'); for (let file of files) { let name = path + '/' + file.split('.')[0] + '.js'; buildify() .load('resources/json/' + file) .perform(function(content) { return 'module.exports = ' + content + ';'; }) .save(name); //console.log('Created ' + name); } process.exit();
Version data entries
30 entries across 30 versions & 1 rubygems