1.0.0 • Published 4 months ago

youcache v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

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);