npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bisheng-formatter-core

v0.2.10

Published

> '毕昇'-中英文混排工具核心 NPM 包

Downloads

6

Readme

Project Bisheng - NPM Package

'毕昇'-中英文混排工具核心 NPM 包

Installation


npm i bisheng-formatter-core -S

Basic Usage

const {
  bishengFormat
} = require("bisheng-formatter-core");
/* import { bishengFormat } from "bisheng-formatter-core"; */

const formattedContent = bishengFormat("在这里可以放上一堆CN和EN混排的文本。")
console.log(formattedContent);

Configuration

const config = {
  mainFeature: {
    /* 
      决定是否格式化全角 markdown 链接
        before: [title](link)
        after: [title](link)
    */
    markdownLinksInFullWidth: true,

    /* 
      决定是否在粗体两侧添加空格
        before: 这里是**粗体**文本
        after: 这里是 **粗体** 文本
    */
    boldTextBlock: true,

    /* 决定是否清空连续的空行 */
    blankLines: true,

    /*  
      决定是否格式化连续的标点符号: 一般是多个句号组成的省略号 (。。。。。) 以及多个感叹号或问号。
        before: 这里是一段中文带着很多很多的感叹号和问号!!!!!!!!!!!??????????????
        after: 这里是一段中文带着很多很多的感叹号和问号!!!???
     */
    duplicatedPunctuations: true,

    /* 
      决定是否格式化全角符号/数字/英文字符
        before: 这里是一段中文,带着中文符号。这里是一段ChineseText!带着Chinese Punctuations?
        after: 这里是一段中文, 带着中文符号. 这里是一段 ChineseText! 带着 Chinese Punctuations?
    */
   fullWidthCharsAndFollowingSpaces: true,

    /* 
      决定是否格式化半角符号/数字/英文字符
        before: 这一幕被一楼 DHBM 系统监控到,30 秒内关闭了系统.
        after: 这一幕被一楼 DHBM 系统监控到, 30 秒内关闭了系统.
     */
    halfWidthCharsAndFollowingSpaces: true,

    /* 决定是否在中文和英文之间添加空格 */
    addSpacesBetweenChineseCharAndAlphabeticalChar: true
  },

  /* 
    如果 duplicatedPunctuations = true, 决定替换成多少个连续的符号
    如果设置为 6 
      before: 这里是一段中文带着很多很多的感叹号和问号!!!!!!!!!!!!!!!!!!
      after: 这里是一段中文带着很多很多的感叹号和问号!!!!!!
   */
  ellipsisCount: 3,

  /* 
    决定是否使用常用标点替换全角引号
    true: 使用 (""'') 替换 (“”‘’)
    false: 使用 (『』「」) 替换 (“”‘’)
  */
  useSimpleQuotation: false
}

const formattedContent = bishengFormat("在这里可以放上一堆CN和EN混排的文本。", config)
console.log(formattedContent);

Dev

npm i