Comments (7)
Yes, Iām ok with using fs-extra.
from memoize-fs.
Or, I'm guessing that if we make a simple check if there is astBody: true
to put function's ast there instead of silently ignore.
from memoize-fs.
Some other ways are https://github.com/luin/serialize and https://www.npmjs.com/package/serializr
from memoize-fs.
can confirm that with node-serialize
everything works :) We should not worry about the "security implications" since we are in the fs and most probably there won't have (end-)user input ability given by the developer anyway.
serializr
package wants some schema and stuff and is too much for our case.
from memoize-fs.
Want PR? We also can allow passing serialize
and deserialize
as options.
- JSON.parse(resultString).data
+ return deserialize(resultString).data
and
const meriyah = require('meriyah')
+ const {serialize, unserialize: deserialize} = require('node-serialize')
from memoize-fs.
Hey @tunnckoCore, I like the idea of having the ability to use a custom serializer, or choosing one using an option. Maybe could list one as a peer dependency. PRs welcome š
from memoize-fs.
Yea, i gone for the options method in my patch too, I'll PR.
Are you okay including fs-extra
instead of fs
in that PR too? It fixes other problems (including one if you use fs.mkdir recursive: true
as I suggested) when you have high parallelism (i'm running memoize-fs
inside jest-runner which runner runs hundreds of files).
from memoize-fs.
Related Issues (11)
- breaking change (Double-Quotes in Strings) between 0.1.7 and 0.1.8/0.1.9 HOT 2
- Note about storing instances of objects
- shift-parser throws when we try to use astBody: true HOT 3
- Changing the body of the memoized function invalidates cache HOT 2
- Importing from TypeScript fails (because of problem with `exports` field?) HOT 4
- maxAge should be stored in file instead of setTimeout, so cache is properly invalidated across several runs HOT 9
- Timed cache invalidation HOT 2
- { force: true } only works once. HOT 2
- Promisified function that also accepts callback HOT 1
- Serialize function AST instead of source HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memoize-fs.