youcache

1.0.0 • Public • Published

YouCache

Create temporary files in the device cache using env-paths-ts to get the directories on different operating systems

[!WARNING] If the environment where youcache is running is suddenly shut down without warning, the temporary file will not be deleted.

[!NOTE] youcache uses the same properties of set, get and remove from the library youfile.

Use

Module

import { YCache } from "youcache";

Commonjs

const { YCache } = require("youcache");

Initialize

const mycache = new YCache("mycache-name");

mycache.set

Create File

mycache.set(src, data);

[!TIP] If you are working with objects you can put the object directly as data in the json file.

Create Folder

To create a folder you just have to put false in the data

mycache.set(src, false);

mycache.get

mycache.get(src);

[!NOTE] When obtaining data from a file with the extension .json it will already be an object

mycache.remove

Deletes files and directories

yfile.remove(src);

Dependencies (5)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i youcache

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.61 kB

    Total Files

    4

    Last publish

    Collaborators

    • fedyou