@frctl/file

0.5.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @frctl/file

Weekly Downloads

13

Version

0.5.0

License

MIT

Last publish

Collaborators

  • mihkeleidast
  • chapabu
  • tomdavies
  • allmarkedup
  • dkhuntrods