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

next-build-cache

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-build-cache

Ultra simple file system based caching built for the next.js build process.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
increased by110.53%
Maintainers
1
Weekly downloads
 
Created
Source

next-build-cache

Next Build Cache is a ultra simple file-based caching solution built for usage during the Next.js build process to pass data from getStaticPaths to getStaticProps without re-fetching data.

The Problem:

Next.js calls separate workers for getStaticPaths and getStaticProps, which means that data cannot be cached in-memory to re-use in getStaticProps.

Installation

Using npm

$ npm i next-build-cache

Using yarn

$ yarn add next-build-cache

Usage

// using es modules 
import { accessCache } from 'next-build-cache';
// using commonjs
const { accessCache } = require('next-build-cache');

// access the cache using the file 'build.cache'
const cache = accessCache('build.cache');

// save a key-value pair with a specified time to live in ms
await cache.put('mykey', 'myvalue', 1000);

// get the value of a key
const value = await cache.get('mykey');

License

MIT

Keywords

FAQs

Package last updated on 27 Feb 2021

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