Socket
Book a DemoInstallSign in
Socket

@last-rev/cms-sync-to-fs

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@last-rev/cms-sync-to-fs

This library syncs content from contentful to the local filesystem. Can be called directly from code as a library, or as a CLI.

0.2.2
latest
npmnpm
Version published
Weekly downloads
136
54.55%
Maintainers
5
Weekly downloads
 
Created
Source

Overview

This library syncs content from contentful to the local filesystem. Can be called directly from code as a library, or as a CLI.

Usage

CLI

npm install -g @last-rev/cli

last-rev cms-sync -d graphql/content

See Docs for details on the parameters.

Library

import sync from '@last-rev/contentful-sync-to-fs'

async function () {
  await sync({
    rootDir: './graphql/content', // Root directory to sync content to
    accessToken: process.env.CONTENTFUL_ACCESSTOKEN, // Contentful access token
    space: process.env.CONTENTFUL_SPACE_ID, // Contentful space ID
    environment: process.env.CONTENTFUL_ENV || 'master', // Contentful environment
    host = process.env.CONTENTFUL_HOST || 'cdn.contentful.com' // Contentful host
  });
};

Output

The library outputs all content to the passed in rootDir location in the following structure:

  • Entries: {space_id}/{environment}/{preview_or_production}/entries/{entry_id}.json
  • Assets: {space_id}/{environment}/{preview_or_production}/assets/{asset_id}.json
  • Content Types: {space_id}/{environment}/{preview_or_production}/content_types/{contentTypeId}.json
  • Entry IDs by Content type lookup: {space_id}/{environment}/{preview_or_production}/entry_ids_by_content_type/{entryId} - Note, this file has no content. The titles in the directory will simply be read to get the IDs

FAQs

Package last updated on 18 Jul 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.