1.0.39 • Published 1 year ago

@node-novel/cache-loader v1.0.39

Weekly downloads
43
License
ISC
Repository
github
Last release
1 year 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

1 year ago

1.0.38

1 year ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.28

5 years ago

1.0.26

5 years ago

1.0.22

5 years ago

1.0.24

5 years ago

1.0.18

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.17

5 years ago

1.0.15

5 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago