Socket
Socket
Sign inDemoInstall

metalsmith-firebase

Package Overview
Dependencies
121
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metalsmith-firebase

Load firebase data into metalsmith.


Version published
Weekly downloads
19
increased by90%
Maintainers
1
Install size
8.69 MB
Created
Weekly downloads
 

Readme

Source

metalsmith-firebase npm Travis Codecov

Load firebase data into metalsmith.

Installation

$ npm install metalsmith-firebase --save

Usage

CLI

Add metalsmith-firebase to your metalsmith.json plugins and specify your firebase options:

{
  "plugins": {
    "metalsmith-firebase": {
      "url": "https://myfirebase.firebaseio.com",
      "options": {
        "collections": [
          "pages",
          "posts"
        ]
      }
    }
  }
}
JS

Pass options to the firebase plugin and pass it to Metalsmith with the use method:

import firebase from 'metalsmith-firebase';

metalsmith.use(firebase({
  url: 'https://myfirebase.firebaseio.com',
  options: {
    collections: [
      "pages",
      "posts"
    ]
  }
}));

You can specify options to merge data into files. By including "collections", you can specify the references that will be used to create pages from a _key property. For example, if I have _key: posts/2016-09-05-metalsmith-firebase, a file will be created with that _key, the property will be removed, and all the data will be assigned to that object, including contents which will be transformed to a buffer for other metalsmith plugins.

Access the data on the firebase object within the template file.

License

MIT

FAQs

Last updated on 03 Nov 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc