1.0.0 • Published 4 months ago
youcache v1.0.0
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 ofset
,get
andremove
from the libraryyoufile
.
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 theobject
directly as data in thejson
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);
1.0.0
4 months ago