https://github.com/markthree/thermal-fn
Persistence Cache Function | 持久化缓存函数
https://github.com/markthree/thermal-fn
fn node persistence
Last synced: about 1 year ago
JSON representation
Persistence Cache Function | 持久化缓存函数
- Host: GitHub
- URL: https://github.com/markthree/thermal-fn
- Owner: markthree
- License: mit
- Created: 2023-04-15T11:42:15.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-28T04:33:58.000Z (about 2 years ago)
- Last Synced: 2025-02-13T15:43:16.431Z (about 1 year ago)
- Topics: fn, node, persistence
- Language: TypeScript
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# thermal-fn
Persistence Cache Function | 持久化缓存函数
## Usage
### install
```shell
npm i thermal-fn
```
```ts
import { useThermal } from "thermal-fn"
const { invoke } = useThermal()
// The node will execute caching, even if the node restarts
// node 将会执行缓存,即使 node 重新启动
const result = await invoke(function largeComputing(boundary) {
let i = 0;
while (boundary - i !== 0) {
i++;
}
return i;
}, 1000000000)
```
## License
Made with [markthree](https://github.com/markthree)
Published under [MIT License](./LICENSE).