0.4.0 • Published 1 month ago

@last-rev/contentful-sync-to-fs v0.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 month ago

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
0.4.0

1 month ago

0.3.11

12 months ago

0.3.10

1 year ago

0.3.9

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago