New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@gorgonjs/file-provider

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gorgonjs/file-provider

A simple file caching provider for Gorgon JS

latest
Source
npmnpm
Version
1.5.1
Version published
Maintainers
1
Created
Source

Gorgon File Provider

This library implements a file storage provider to @gorgonjs/gorgon, please refer to the documentation on https://gorgonjs.dev for full documentation.

Installation

npm install @gorgonjs/file-provider @gorgonjs/gorgon

yarn add @gorgonjs/file-provider @gorgonjs/gorgon

pnpm add @gorgonjs/file-provider @gorgonjs/gorgon

Example Usage

import { Gorgon } from '@gorgonjs/gorgon';
import { FileProvider } from '@gorgonjs/file-provider';

// Create a new instance of the file provider
const fileCache = FileProvider(cachePath, { createSubfolder: false });

// Add the provider to the gorgon instance
Gorgon.addProvider('perm', fileCache);

// Call an API and cache the results forever
const x = await Gorgon.get(
  `tmdb/movie/${id}`,
  async () => {
    return axios.get(`${api}/movie/${id}${key}`);
  },
  { provider: 'perm', expiry: false },
);

Keywords

cache

FAQs

Package last updated on 08 Oct 2023

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