
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
contentful-batch-libs
Advanced tools
The contentful-batch-libs package provides a set of tools for performing batch operations with Contentful, a content management system (CMS). It is particularly useful for tasks such as exporting, transforming, and importing content in bulk.
Exporting Content
This feature allows you to export all content from a specified Contentful space. The code sample demonstrates how to use the getFullSourceSpace function to export content using your space ID and management token.
const { getFullSourceSpace } = require('contentful-batch-libs');
const options = {
spaceId: 'your_space_id',
managementToken: 'your_management_token'
};
getFullSourceSpace(options)
.then((space) => {
console.log('Exported space:', space);
})
.catch((error) => {
console.error('Error exporting space:', error);
});
Transforming Content
This feature allows you to transform content from one space to another. The code sample shows how to use the transformSpace function to transform content between two spaces.
const { transformSpace } = require('contentful-batch-libs');
const sourceSpace = { /* source space data */ };
const destinationSpace = { /* destination space data */ };
transformSpace(sourceSpace, destinationSpace)
.then((transformedSpace) => {
console.log('Transformed space:', transformedSpace);
})
.catch((error) => {
console.error('Error transforming space:', error);
});
Importing Content
This feature allows you to import content into a specified Contentful space. The code sample demonstrates how to use the createEntities function to import content using your space ID, management token, and the content to be imported.
const { createEntities } = require('contentful-batch-libs');
const options = {
spaceId: 'your_space_id',
managementToken: 'your_management_token',
content: { /* content to import */ }
};
createEntities(options)
.then((result) => {
console.log('Imported content:', result);
})
.catch((error) => {
console.error('Error importing content:', error);
});
The contentful-import package is used to import content into a Contentful space. It provides similar functionality to the import feature of contentful-batch-libs but is more focused on the import process specifically.
The contentful-export package is used to export content from a Contentful space. It offers similar functionality to the export feature of contentful-batch-libs but is dedicated solely to exporting content.
The contentful-migration package is used to script and run migrations on Contentful spaces. While it does not provide batch import/export functionality, it is useful for transforming content models and entries, which can complement the features of contentful-batch-libs.
This repository contains shared methods used within Contentful's import and export tools.
Even when these parts are fairly small and independent, they might not be easy to understand and use for your own projects right now.
Each module has more extensive documentation in the code regarding their own purpose.
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.
Used to get content from a space, intended to be copied somewhere else, or manipulated.
Gets content from a space which will have content copied to it, based on a collection of existing content.
Entity creation methods.
Asset processing methods.
Entity deletion methods.
Entity publishing methods.
Pushes all changes, including deletions, to a given space. Handles (un)publishing as well as delays after creation and before publishing.
Creates everything in the right order so that a content type for a given entry is there when entry creation for that content type is attempted.
Allows only content model or only content pushing.
Transforms all the content from a space, in order to ready it to be sent to another space.
Transformer methods for each kind of entity.
Creates delivery and management client instances for both source and destination spaces.
Gathers errors in an internal buffer which can then be drained in order to output them to a user.
Check out the releases page.
FAQs
Library modules used by contentful batch utility CLI tools.
The npm package contentful-batch-libs receives a total of 162,433 weekly downloads. As such, contentful-batch-libs popularity was classified as popular.
We found that contentful-batch-libs demonstrated a not healthy version release cadence and project activity because the last version was released 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.