yarn add firost
// or npm install firost
You can require
the whole of firost
and use its methods, or require
each
method individually.
// Require everything
const firost = require('firost');
// Cherry-pick what to require
const glob = require('firost/glob');
const copy = require('firost/copy');
Below are a few examples of the tasks firost
can help you with:
const packageRoot = require('firost/packageRoot');
const readJson = require('firost/readJson');
const path = require('path');
(async () => {
const { version } = await readJson(
path.resolve(packageRoot(), 'package.json')
);
})()
const readJsonUrl = require('firost/readJsonUrl');
const write = require('firost/write');
(async () => {
const url =
"https://raw.githubusercontent.com/pixelastic/firost/master/package.json";
const data = await readJsonUrl(url);
await write(data.description, './description.txt');
})();
.css
files from ./src
to ./dist
const copy = require('firost/copy');
(async () => {
await copy('./src/**/*.css', './dist');
})();