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 - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

package.json
{
"name": "cf-redis",
"version": "0.1.4",
"version": "0.1.5",
"description": "A tiny library to map Contentful ☁️ space into Redis ⚡️",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -1,70 +0,1 @@

<div align="center">
<h1>Contentful Redis</h1>
[![npm](https://img.shields.io/npm/v/cf-redis.svg)](https://www.npmjs.com/package/cf-redis) [![license](https://img.shields.io/github/license/shreyas-a/cf-redis.svg)](https://github.com/shreyas-a/cf-redis/blob/master/LICENSE)
A tiny library to map Contentful ☁️ space into Redis ⚡️
</div>
## Installation
```sh
npm install cf-redis --save
```
## Usage
Create an instance of `cf-redis` by passing contentful space ID & access token.
```js
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 🎉
```js
await client.sync();
```
### get
Gets all data directly from Redis 🚀
```js
const response = await client.get();
console.log(response);
```
You can also pass specific content type.
```js
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.
```js
{
"<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 ❤
WARNING - This package is renamed to [**redis-contentful**](https://www.npmjs.com/package/redis-contentful)
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