@frctl/file

Fractal file metadata format

Stats

StarsIssuesVersionUpdatedCreatedSize
@frctl/file
0.5.05 years ago5 years agoMinified + gzip package size for @frctl/file in KB

Readme

File

File metadata object for use in Fractal

Build Status NPM Version

const File = require('@frctl/file');

const file = new File({
  base: '/components',
  path: '/components/patterns/_04-button--large.hbs',
  contents: new Buffer('<button class="button button--large">{{ buttonText }}</button>')
});

console.log(file.stem); // '_04-button--large'
console.log(file.relative); // 'patterns/_04-button--large.hbs

const fromRealFile = File.from('/path/to/file.js', {base: '/path'}).then(file => {
  console.log(file.contents);
});

Install

npm i @frctl/file --save

Requirements

@frctl/file requires Node >= v6.0

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.