Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

contentful-parsers

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-parsers

Library of useful parsers to use when working with Contentful API responses.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.3K
increased by1.53%
Maintainers
1
Weekly downloads
 
Created
Source

🧰 contentful-parsers

npm version npm Coverage Status CircleCI Greenkeeper badge

Toolbox of useful parsers to use when working with Contentful API responses.

Install

Via npm

npm install contenful-parsers

Via Yarn

yarn add contenful-parsers

Parsers

fieldsParser

Probably the most common parser of the lot. This will take a Contentful response, either an array or a single item, and parse the items to flatten all of the fields objects and remove the majority of the sys objects, except for a reference to the sys.contentType.sys.id, in case you are doing any based on that for your rendering.

How to use
import contentful from 'contentful';
import { fieldsParser } from 'contentful-parsers';


const client = contentful.createClient({
  space: '[SPACE_ID]',
  accessToken: '[ACCESS_TOKEN]',
});

const response = await client.getEntry('[ENTRY_ID]');
const data = fieldsParser(response);

Input

Coming soon

Output

Coming soon

License

MIT © Ryan Hefner

Keywords

FAQs

Package last updated on 29 Mar 2019

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc