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

cf-redis

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-redis

A tiny library to map Contentful ☁️ space into Redis ⚡️

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Contentful Redis

npm license

A tiny library to map Contentful ☁️ space into Redis ⚡️

Installation

npm install cf-redis --save

Usage


Create an instance of cf-redis by passing contentful space ID & access token.

import cfRedis from 'cf-redis';

const client = new cfRedis({
  space: '<Space ID>',
  accessToken: '<Access Token>',
});

API


sync

Syncs the latest space content from Contentful and dumps it in your Redis server 🎉

await client.sync();

get

Gets all data directly from Redis 🚀

const response = await client.get();
console.log(response);

You can also pass specific content type.

const response = await client.get('about');

You'll get an object with your content type ID's as keys and their values as array of content objects.

{
    "<ContentType ID 1>": [{}, {}, {}],
    "<ContentType ID 2>": [{}]
}

Redis Store

In Redis, the keys (content types) will be prefixed with cf-redis to uniquely identify keys created by cf-redis 🤓


License

MIT ❤

FAQs

Package last updated on 18 Mar 2018

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