Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

contentful-export

Package Overview
Dependencies
Maintainers
1
Versions
526
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-export

this tool allows you to export a space to a JSON dump

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
109K
decreased by-2.47%
Maintainers
1
Weekly downloads
 
Created
Source

Contentful Export

npm Build Status Coverage Status Dependency Status devDependency Status

semantic-release js-standard-style

this tool allows you to export a space to a JSON dump

What this tool is for

this tool does one simple thing which is exporting all your space data to a json file that can be used later to import to another space or save as a backup.

Changelog

Check out the releases page.

Install

npm install -g contentful-export

Usage

Usage: contentful-export [options]

Options:
  --version           Show version number                              
  --space-id          ID of Space with source data           
                      [string] [required]
  --management-token  Management API token for the space to be exported.
                      [string] [required]
  --export-dir        Defines the path for storing the export json file
                      (defaultpath is the current directory) [string]
  --config            Configuration file with required values

The --management-token parameter allows you to specify a token which will be used for both spaces. If you get a token from https://www.contentful.com/developers/docs/references/authentication/ and your user account has access to both spaces, this should be enough.

Check the example-config.json file for an example of what a configuration file would look like. If you use the config file, you don't need to specify the other options for tokens and space ids.

Example usage

contentful-export \
  --space-id spaceID \
  --management-token managementToken

or

contentful-export --config example-config.json

You can create your own config file based on the example-config.json file.

Usage as a library

While this tool is mostly intended to be used as a command line tool, it can also be used as a Node library:

var spaceExport = require('contentful-export')

spaceExport(options)
.then((output) => {
  console.log('space data', output)
})
.catch((err) => {
  console.log('oh no! errors occurred!', err)
})

The options object can contain any of the CLI options but written with a camelCase pattern instead, and no dashes. So --space-id would become spaceId. Apart from those options, there are an additional ones that can be passed to it:

  • errorLogFile - File to where any errors will be written.

Keywords

FAQs

Package last updated on 22 Jun 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc