netlify-db v0.0.2
Netlify-db
Use your favorite framework with Netlify CMS.
netlify-db will parse markdown files generated by Netlify CMS, and create a single json file you can use as your database. Get the performance benefits of a static page generator, while still using your favorite front-end setup.
Installation
Firstly, install the package using Yarn or NPM
yarn add netlify-db --devor
npm install --save-dev netlify-dbUsage
Once that's done, you can run this command inside your project's directory:
netlify-db create <admin folder> <database folder>Example:
netlify-db create public/admin srcYou should run this before your build script so Netlify can create a fresh json file for each change.
"scripts": {
"build": "npm run build:db && npm run build:app",
"build:db": "netlify-db create public/admin src",
"build:app": "your-build-script"
}That's it! :tada:
Options
-w --watch to watch markdown files and write to the database. Useful when developing and pulling new changes, or if you want to see changes when editing the markdown.
-n --name name for the database. ex: --name my-database
Author
Leif Riksheim (@leifriksheim) - WTFoo