1.0.39 • Published 3 months ago

@node-novel/cache-loader v1.0.39

Weekly downloads
43
License
ISC
Repository
github
Last release
3 months ago

@node-novel/cache-loader

讀寫分析 novel-stat.json

install

npm install @node-novel/cache-loader

demo

import create, { createFromJSON } from '@node-novel/cache-loader';
import path = require('upath2');

/**
 * 從檔案來讀取設定
 */
const novelStatCache = create({
	file: path.join(__dirname, 'res', 'novel-stat.json'),
	//file_git: path.join(__dirname, 'res', 'novel-stat.json'),
});

console.dir(novelStatCache);

/**
 * 從其他方式取得 data 來輸入資料
 * 例如 透過 AJAX 取得伺服器上的 json
 */
const data: INovelStatCache = {
	novels: {},
	mdconf: {},
	meta: {},
	history: {},
};

const novelStatCache2 = createFromJSON(data);

console.dir(novelStatCache2);

/**
 * 取得所有小說的最終狀態(預設時)
 * 例如 當 同時存在 xxx 與 xxx_out 時,只會回傳 xxx_out
 */
console.log(novelStatCache.filterNovel());
1.0.39

3 months ago

1.0.38

3 months ago

1.0.37

1 year ago

1.0.36

2 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.28

4 years ago

1.0.26

4 years ago

1.0.22

4 years ago

1.0.24

4 years ago

1.0.18

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.17

4 years ago

1.0.15

4 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago