v0.2.1
To provide an simple interface to the masthead API within node.
- Install the node module using the setup instructions below.
- Import / Require the masthead
- Call masthead.get() and receive a promise
import masthead from 'masthead';
masthead.get()
.then(function(assets) {
console.log(assets);
})
.catch(function(error) {
// An asset could not be retrieved
});
npm install
npm run dev
npm install --save https://github.com/sky-uk/node-masthead-injector.git
npm test
You can override these attributes by calling masthead.setConfig()
before calling masthead.get()
. Pass in an object to override individual attributes or the entire object.
{
host: 'https://assets.sky.com/new',
siteArea: 'help-and-support',
assets: [{
section: 'head',
path: '/resources/css'
}, {
section: 'header',
path: '/masthead/help-and-support'
}, {
section: 'footer',
path: '/footer'
}, {
section: 'js',
path: '/resources/js'
}]
}