cedr-deps

0.1.1 • Public • Published

cedr-deps NPM version Build Status Dependency Status

Cedr-deps - Generating globs dependencies for cedr.

Installation

$ npm install --save cedr-deps

Usage

Used in conjunction with cedr. Needed to generating globs dependencies for page.

const deps = require('cedr-deps');

let library = {
  'menu': {
    templates: {
      'menu': '<div>Menu</div>',
      '__item': '<div>Menu item</div>'
    },
    styles: {
      'menu/style.css': 'test/lib1/menu/style.css'
    },
    scripts: {}
  },
  'page': {
    templates: {},
    styles: {
      'page/style.css': 'test/lib1/page/style.css'
    },
    scripts: {}
  }
}

let page = {
  block: 'page',
  content: [
    {
      block: 'text',
      content: 'text'
    },
    {
      block: 'page',
      element: 'header',
      content: 'Yeah!'
    }
  ]
};

deps(page, library); 
// Return { style: ['test/lib1/page/style.css'], script: [] }

API

cedr-deps(page, library)

page

Type: Object

The object of page.

library

Type: Object

The object of library.

Returns a Object:

{
  style: [],
  script: []
}

License

MIT © antitim

Readme

Keywords

Package Sidebar

Install

npm i cedr-deps

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • antitim