ocache
npmv0.3.0TypeScriptComposable caching primitives with TTL, SWR, and HTTP response caching
Safe to adopt
Yes — ocache scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 22 days ago. 7 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- AMaintenance: grade A, Excellent.
Last published 22 days ago. 7 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 99 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding ocache to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- ESM only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the ocache README.
import { defineCachedFunction } from "ocache";
const cachedFetch = defineCachedFunction(
async (url: string) => {
const res = await fetch(url);
return res.json();
},
{
maxAge: 60, // Cache for 60 seconds
name: "api-fetch",
},
);
// First call hits the function, subsequent calls return cached resultDependencies
Declared by ocache v0.3.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (12)
Used by
Popular packages that depend on ocache.
Relationship graph
Dependencies (left) and dependents (right) of ocache.
Frequently installed together
Cross-platform WebSocket Servers for Node.js, Deno, Bun and Cloudflare Workers
TypeScript-first schema declaration and validation library with static type inference
An extremely fast JavaScript and CSS bundler and minifier.
Native-ESM powered web dev build tool
React is a JavaScript library for building user interfaces.
React package for working with the DOM.
TypeScript definitions for react-dom
Fast, unopinionated, minimalist web framework
Next generation testing framework powered by Vite
Minimal H(TTP) framework built for high performance and portability.
Get an available TCP port to listen
Modify strings, generate sourcemaps
Release history
7 releases in the last two years, typically about 29 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 0.3.0latest | 22 days ago | 99 KB | MIT |
| 0.2.0 | 2 months ago | 55 KB | MIT |
| 0.1.5 | 3 months ago | 35 KB | MIT |
| 0.1.4 | 5 months ago | 34 KB | MIT |
| 0.1.3 | 5 months ago | 34 KB | MIT |
| 0.1.2 | 6 months ago | 25 KB | MIT |
| 0.1.1 | 6 months ago | 23 KB | MIT |
| 0.0.0 | 4 years ago | 61 B | MIT |
Overview
ocache is an npm package that composable caching primitives with TTL, SWR, and HTTP response caching. It has 1 known dependents in the graph. The latest version is 0.3.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need composable caching primitives with TTL, SWR, and HTTP response caching and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use ocache?
Yes — ocache scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 22 days ago. 7 releases in the last 2 years.
How do I install ocache?
Run `npm install ocache` to add ocache to your npm project.
What license is ocache released under?
ocache is distributed under the MIT license.
How popular is ocache?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on ocache.
Is ocache still maintained?
The most recent release of ocache (v0.3.0) was published 22 days ago.
Does ocache run install scripts?
No. ocache does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.