开源项目 emphasize 使用教程
emphasizeANSI syntax highlighting for the terminal项目地址:https://gitcode.com/gh_mirrors/em/emphasize
1. 项目的目录结构及介绍
emphasize/
├── LICENSE
├── README.md
├── bin/
│ └── emphasize.js
├── index.js
├── package.json
└── test/
└── index.js
- LICENSE: 项目许可证文件。
- README.md: 项目说明文档。
- bin/: 包含可执行文件的目录。
- emphasize.js: 项目的启动文件。
- index.js: 项目的主入口文件。
- package.json: 项目的配置文件。
- test/: 包含测试文件的目录。
- index.js: 测试文件。
2. 项目的启动文件介绍
项目的启动文件位于 bin/emphasize.js
。该文件是项目的可执行文件,负责启动和运行项目。
3. 项目的配置文件介绍
项目的配置文件是 package.json
。该文件包含了项目的基本信息、依赖项、脚本命令等配置。
{
"name": "emphasize",
"version": "4.0.0",
"description": "Safe high-level text highlighting",
"license": "MIT",
"keywords": [
"text",
"highlight",
"highlighting",
"emphasis",
"emphasize"
],
"repository": "wooorm/emphasize",
"bugs": "https://github.com/wooorm/emphasize/issues",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"files": [
"bin/emphasize.js",
"index.js"
],
"bin": {
"emphasize": "bin/emphasize.js"
},
"dependencies": {
"escape-string-regexp": "^1.0.0",
"meow": "^5.0.0"
},
"devDependencies": {
"browserify": "^16.0.0",
"nyc": "^14.0.0",
"prettier": "^1.0.0",
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"tape": "^4.0.0",
"tinyify": "^2.0.0",
"xo": "^0.25.0"
},
"scripts": {
"build-bundle": "browserify index.js -s emphasize -o emphasize.js",
"build-mangle": "browserify index.js -s emphasize -p tinyify -o emphasize.min.js",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js"
},
"nyc": {
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"unicorn/prefer-module": "off"
},
"ignores": [
"emphasize.js",
"emphasize.min.js"
]
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
}
}
emphasizeANSI syntax highlighting for the terminal项目地址:https://gitcode.com/gh_mirrors/em/emphasize