https://github.com/sky-uk/node-masthead-injector
Used to place masthead footer and header onto our node apps
https://github.com/sky-uk/node-masthead-injector
digital-help online-service
Last synced: 10 months ago
JSON representation
Used to place masthead footer and header onto our node apps
- Host: GitHub
- URL: https://github.com/sky-uk/node-masthead-injector
- Owner: sky-uk
- License: bsd-3-clause
- Created: 2015-11-05T13:26:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-20T15:47:53.000Z (almost 5 years ago)
- Last Synced: 2023-07-07T11:01:57.885Z (almost 3 years ago)
- Topics: digital-help, online-service
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 42
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# node-masthead-injector
v0.2.1
##### Purpose
To provide an simple interface to the masthead API within node.
##### Usage
1) Install the node module using the setup instructions below.
2) Import / Require the masthead
3) 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
});
```
##### Setup (Development)
`npm install` \
`npm run dev`
##### Setup (As a node module)
`npm install --save https://github.com/sky-uk/node-masthead-injector.git`
##### Tests
`npm test`
##### Overriding the configuration
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'
}]
}
```