@frctl/file

Fractal file metadata format

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@frctl/file
0.5.06 years ago6 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