Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including ghost-export with all npm packages installed. Try it out:

var ghostExport = require("ghost-export")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ghost-export v1.2.2

Exports a Ghost blog into a collection of Markdown files.

ghost-export

NPM version Code Climate Build Status

Exports a Ghost blog into a collection of Markdown files.

Installation

$ npm install -g ghost-export

Usage

# Export published posts only
$ ghost-export /path/to/ghost/app /path/to/output

# Export drafts only
$ ghost-export --drafts /path/to/ghost/app /path/to/output

# Export all posts
$ ghost-export --all /path/to/ghost/app /path/to/output

Alternatively, you can require('ghost-export') and use it in your own scripts. Example:

var GhostExport = require('ghost-export');

GhostExport({
  source: '/path/to/ghost/app',
  destination: '/path/to/output',
  published: true, // optional, defaults to true
  drafts: true // optional, defaults to false
}, function(err, count) {
    if (err) { console.error(err); }
    else { console.log('Exported ' + count + ' files.'); }
});

Testing

$ npm test

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free