1.0.25 • Published 3 months ago

@node-novel/parse-txt-tag v1.0.25

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

@node-novel/parse-txt-tag

分析 node-novel 風格的 txt tag

install

yarn add @node-novel/parse-txt-tag

demo

import { outputFile, readFile } from 'fs-extra';
import { join } from 'path';
import { parse } from '@node-novel/parse-txt-tag';

const rootDir = join(__dirname, '..');

readFile(join(rootDir, 'test/res', '排版格式.txt'))
	.then(buf => {
		return parse(buf.toString(), {
			on: {
				default({
					tagName,
					innerContext,
					cache,
					attach,
				})
				{
					console.dir({
						tagName,
						innerContext,
					});

					return null // 如果回傳非 null 則會取代原始文字內容
				}
			}
		})
	})
	.then(v => console.dir(v))
;
1.0.25

3 months ago

1.0.24

3 months ago

1.0.23

1 year ago

1.0.22

2 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.14

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago