Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@node-novel/parse-txt-tag

bluelovers78ISC1.0.25TypeScript support: included

分析 node-novel 風格的 txt

@node-novel, node-novel, parse-txt-tag

readme

@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))
;

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.25 (2024-02-03)

🔖 Miscellaneous

1.0.24 (2024-01-29)

BREAKING CHANGES

  • use sub pkg

📌 Dependencies

🔖 Miscellaneous

1.0.23 (2022-11-04)

📌 Dependencies

1.0.22 (2022-05-16)

🐛 Bug Fixes

  • update regexp-cjk-plugin-escape-unicode-property (23e1c4d)

🛠 Build System

♻️ Chores

1.0.21 (2021-07-08)

🛠 Build System

  • update deps and use tslib (bc00796)

1.0.20 (2021-02-12)

🛠 Build System

1.0.19 (2021-02-12)

♻️ Chores

1.0.18 (2020-08-13)

♻️ Chores

1.0.17 (2020-07-19)

🛠 Build System

♻️ Chores

1.0.16 (2020-06-30)

🐛 Bug Fixes

1.0.15 (2020-06-30)

♻️ Chores

1.0.14 (2020-06-20)

🔖 Miscellaneous

1.0.13 (2020-06-20)

♻️ Chores

1.0.12 (2020-06-08)

Note: Version bump only for package @node-novel/parse-txt-tag

1.0.11 (2020-06-05)

Note: Version bump only for package @node-novel/parse-txt-tag

1.0.10 (2020-06-05)

Note: Version bump only for package @node-novel/parse-txt-tag

1.0.9 (2020-06-04)

Features

1.0.8 (2020-06-04)

Features