Gathering detailed insights and metrics for contentful-import
Gathering detailed insights and metrics for contentful-import
Gathering detailed insights and metrics for contentful-import
Gathering detailed insights and metrics for contentful-import
Node module that uses the data provided by contentful-export to import it to contentful space
npm install contentful-import
58.8
Supply Chain
89.3
Quality
93.5
Maintenance
100
Vulnerability
95.3
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
101 Stars
1,123 Commits
39 Forks
68 Watching
29 Branches
244 Contributors
Updated on 25 Nov 2024
TypeScript (99.08%)
JavaScript (0.92%)
Cumulative downloads
Total Downloads
Last day
-1.2%
13,235
Compared to previous day
Last week
-6.1%
70,080
Compared to previous week
Last month
5%
354,895
Compared to previous month
Last year
36%
3,157,407
Compared to previous year
15
Contentful provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.
This library helps you to import files generated by contentful-export to a destination space.
We moved the CLI version of this tool into our Contentful CLI. This allows our users to use and install only one single CLI tool to get the full Contentful experience.
Please have a look at the Contentful CLI import command documentation to learn more about how to use this as command line tool.
1npm install contentful-import
1const contentfulImport = require('contentful-import') 2 3const options = { 4 content: {entries:..., contentTypes:..., locales:...}, 5 spaceId: '<space_id>', 6 managementToken: '<content_management_api_key>', 7 ... 8} 9 10contentfulImport(options) 11 .then(() => { 12 console.log('Data imported successfully') 13 }) 14 .catch((err) => { 15 console.log('Oh no! Some errors occurred!', err) 16 })
Using ESM:
1import spaceImport from 'contentful-import';
or
1const contentfulImport = require('contentful-import') 2 3const options = { 4 contentFile: '/path/to/result/of/contentful-export.json', 5 spaceId: '<space_id>', 6 managementToken: '<content_management_api_key>', 7 ... 8} 9 10contentfulImport(options) 11 .then(() => { 12 console.log('Data imported successfully') 13 }) 14 .catch((err) => { 15 console.log('Oh no! Some errors occurred!', err) 16 })
1const contentfulImport = require('contentful-import') 2 3const options = { 4 contentFile: '/path/to/result/of/contentful-export.json', 5 spaceId: '<space_id>', 6 managementToken: '<content_management_api_key>', 7 environmentId: '<environment_id>', 8 ... 9} 10 11contentfulImport(options) 12...
spaceId
[string] [required]ID of the space to import into
environmentId
[string] [default: 'master']ID of the environment in the destination space
managementToken
[string] [required]Contentful management API token for the space to be imported to
contentFile
[string]Path to JSON file that contains data to be import to your space
content
[object]Content to import. Needs to match the expected structure (See below)
contentModelOnly
[boolean] [default: false]Import content types only
skipContentModel
[boolean] [default: false]Skip importing of content types and locales
skipLocales
[boolean] [default: false]Skip importing of locales
skipContentUpdates
[boolean] [default: false]Skip updating existing content
skipContentPublishing
[boolean] [default: false]Skips content publishing. Creates content but does not publish it
uploadAssets
[boolean] [default: false]Upload local asset files downloaded via the downloadAssets option of the export. Requires assetsDirectory
skipAssetUpdates
[boolean] [default: false]Skip updating existing assets
assetsDirectory
[string]Path to a directory with an asset export made using the downloadAssets option of the export. Requires uploadAssets
timeout
[number] [default: 3000]Time between retries on asset processing
retryLimit
[number] [default: 10]Maximum number of retries for asset processing
host
[string] [default: 'api.contentful.com']The Management API host
proxy
[string]Proxy configuration in HTTP auth format: host:port
or user:password@host:port
rawProxy
[boolean]Pass proxy config to Axios instead of creating a custom httpsAgent
rateLimit
[number] [default: 7]Maximum requests per second used for API requests
headers
[object]Additional headers to attach to the requests.
errorLogFile
[string]Full path to the error log file
useVerboseRenderer
[boolean] [default: false]Display progress in new lines instead of displaying a busy spinner and the status in the same line. Useful for CI.
config
[string]Path to a JSON file with the configuration options. This file will be merged with the options passed to the function. The options passed to the function will take precedence over the ones in the config file.
Unable to connect to Contentful through your Proxy? Try to set the rawProxy
option to true
.
1contentfulImport({ 2 proxy: 'https://cat:dog@example.com:1234', 3 rawProxy: true, 4 ... 5})
The data to import should be structured like this:
1{ 2 "contentTypes": [], 3 "entries": [], 4 "assets": [], 5 "locales": [], 6 "webhooks": [], 7 "roles": [], 8 "tags": [], 9 "editorInterfaces": [] 10}
Note: tags
are not available for all users. If you do not have access to this feature, any tags included in your import data will be skipped.
Read the releases page for more information.
This project is licensed under MIT license
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
1 existing vulnerabilities detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More