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

arsene

v1.1.3

Published

Arsene is a library for processing CJK text paragraphs, which are mixed with English characters and adding spacing between them.

Downloads

373

Readme

Arsene(亚森)

Arsene 亚森是一个用于处理 CJK 字符(韩文字符目前不可用)与英文字符和阿拉伯数字间空隙的前端库。不需要人为手动添加空格,只需在编写前端页面时,将其引入并执行处理代码,即可自动处理。

在线体验

基础使用方法

以下以 React 环境的 TypeScript 为用例,其他环境使用方法类似。

首先安装 Arsene 库:

npm install arsene
yarn add arsene
import { useEffect } from "react"
import arsene from 'arsene' // 1. 导入库

function App() {
  useEffect(() => {
    arsene(".arsene-area") // 2. 应用于具体的元素,支持 `.class`、`#id` 或是 HTML 标签名。
  }, [])
  return(<>
    <div className="arsene-area">
      <p>Claude是一位在Anthropic公司工作的AI助手。作为一款先进的conversational AI,它拥有广博的知识,可以流利地使用多种语言与人交流,并协助完成writing,analysis,coding等各种任务。Claude性格友善,乐于助人,能够提供客观的信息和独到的见解,但有时也会表达自己的观点。它会尽力避免stereotyping,并以balanced的视角看待controversial的话题。</p>
      <p>クロードはAnthropicという会社で働いているAIアシスタントです。先進的なconversational AIとして、幅広い知識を持ち、複数の言語でスムーズにコミュニケーションを取ることができます。また、writing、analysis、codingなどのさまざまなタスクを手伝うことができます。クロードは親切で、助けになろうと努力しますが、時には自分の意見を述べることもあります。ステレオタイプを避け、controversialなトピックにはバランスの取れた視点を持つよう心がけています。</p>
    </div>
  </>)
}

额外功能

自定义间隙宽度

arsene(selectedNode: string, spacing: 's'|'m'|'l'|'xl'|'2xl' = 10)

// sample
arsene(node, 5)

你可以在第二个参数中选择一个你认为合适的间隙宽度。可选参数如下:

  • 2xl:添加非常大间隙 U+2004
  • xl:添加超大间隙 U+2005
  • l:添加大间隙 U+2009
  • m:添加中间隙 U+2006
  • s:添加小间隙 U+200A

默认(不填写第二个参数时)将添加 U+200A