
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
doctor-jones
Advanced tools
After all, we should all respect w3c/clreq
链接
文档
·
English README
·
npm Page
相关项目
doctor-jones-loader
·
doctor-jones-extension
·
More to be developed...
doctor-jones 是一个用来格式化中文字符串(包括中英文混排)的工具集,它基于 w3c/clreq 及其他中文排版最佳实践。作为一个工具集,doctor-jones 包括:
npm 包,用于接收字符串,并返回格式化后的字符串webpack loader,用于格式化你的 .js, .ts, .jsx, .tsx, .vue 文件中的字符串doctor-jones-as-a-service,简称 DJaaS(计划中)使用 doctor-jones 可以做到以下格式化:
……“” ‘’ 替换为 「」 『』需要注意的是,这些格式化只对至少包含一个中文字符或全角符号的字符串生效。同时,每个格式化选项都可以通过设置来关闭。
<script type="text/javascript" src="https://unpkg.com/doctor-jones/dist/index.umd.min.js"></script>
npm i doctor-jones -S
// 使用 CDN
const dj = window.dj
// 使用 npm
import dj from 'doctor-jones'
dj('doctor-jones是一个“治疗”中英文混排格式的工具') // 返回 'doctor-jones 是一个「治疗」中英文混排格式的工具'
dj(
// 待格式化的字符串
'doctor-jones是一个“治疗”中英文混排格式的工具',
// 格式化选项
{
// 是否在中文和字母数字之间添加空格
// 可选值:boolean
spacing: true,
// 是否允许在全角符号与字母数字之间存在空格
// 可选值:boolean
spaceBetweenFullwidthPunctuationAndAlphabets: false,
// 是否允许连续的感叹号
// 可选值:boolean
successiveExclamationMarks: false,
// 省略号规范化规则
// 可选值:'none' | '3dots' | 'all'
// 'none':将连续出现两次或以上的 。、,. 规范化为 ……
// '3dots':除 ... 以外,将连续出现两次或以上的 。、,. 规范化为 ……
// 'all':不进行省略号规范化
ellipsisTolerance: 'none',
// 弯引号替换规则
// 可选值:'double' | 'single' | 'none'
// 'double':使用直角引号「」替换弯引号“”,同时使用直角引号『』替换弯引号‘’
// 'single':使用直角引号「」替换弯引号‘’,同时使用直角引号『』替换弯引号“”
// 'none':不替换弯引号
replaceWithCornerQuotes: 'double',
// 是否在数字周围使用半角括号
// 可选值:boolean
halfwidthParenthesisAroundNumbers: true
}
)
全局安装 doctor-jones,即可在终端中使用:
npm i doctor-jones -g
$ doctor-jones --help
Format Options
--spacing, -s 是否在中文和字母数字之间添加空格 [boolean]
--space-between, --sb 是否允许在全角符号与字母数字之间存在空格 [boolean]
--exclamation, --ex 是否允许连续的感叹号 [boolean]
--ellipsis, --el 省略号规范化规则 [choices: "none", "3dots", "all"]
--quote, -q 弯引号替换规则 [choices: "none", "double", "single"]
--parenthesis, -p 是否在数字周围使用半角括号 [boolean]
Options:
--help, -h 帮助信息 [boolean]
--version, -v 当前版本 [boolean]
Examples:
doctor-jones 需要格式化的字符串
doctor-jones -s false 需要格式化的字符串
doctor-jones -s false --el 3dots 需要格式化的字符串
FAQs
After all, we should all respect w3c/clreq
The npm package doctor-jones receives a total of 6 weekly downloads. As such, doctor-jones popularity was classified as not popular.
We found that doctor-jones demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.