
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
contentful-export
Advanced tools
https://www.contentful.com is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit & manage content in the cloud and publish it anywhere via powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.
This is a command line tool (CLI) that help you backup your published Content Model, Content and Assets or move them to a new Contentful space. It will support Editor Interfaces, Webhooks and Roles & Permissions in a future version.
To import your exported data, please refer to the contentful-import repository.
We recommend the installation of this CLI via npm:
npm install -g contentful-export
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
(default path is the current directory) [string]
--max-allowed-limit How many item per page per request default 1000 [number]
--include-drafts Export Drafts entiries, a preview token needs to be provided when the value is true [boolean]
--preview-token Preview API token for the space to be exported. [string]
--download-assets Download the assets along with the exported data [boolean]
--rate-limit How many request per period of time, default 6 [number]
--rate-limit-period How much time to wait before retry in ms, default 1000 [number]
--config Configuration file with required values
The --management-token
parameter allows you to specify a token used for both spaces. If you request a token from here 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 looks like. If you use the configuration file, you don't need to specify the other options for tokens and space ids.
contentful-export \
--space-id spaceID \
--management-token managementToken
or
contentful-export --config example-config.json
You can create your own configuration file based on the example-config.json file.
This is an overview of the exported data:
{
"contentTypes": [],
"entries": [],
"locales": [],
"assets": [],
"webhooks": [],
"editorInterfaces": [],
"roles": []
}
While this tool is intended for use as a command line tool, you can also use it 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. For example --space-id
would become spaceId
.
Another option is errorLogFile
, the location of a file to log errors to.
Read the releases page for more information.
This project is licensed under MIT license
FAQs
this tool allows you to export a space to a JSON dump
The npm package contentful-export receives a total of 99,769 weekly downloads. As such, contentful-export popularity was classified as popular.
We found that contentful-export demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.