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

chinese-writing-style-converter

v0.0.1

Published

A simple library converting chinese style between vertical and horizon.

Downloads

4

Readme

Chinese-Writing-Style-Converter

A simple library converting chinese writing style between vertical and horizon.

簡易中文直書橫書轉換

使用方法

In Node.js

npm install cswc OR npm install [email protected]:imZack/Chinese-Writing-Style-Converter.git

var converter = require('cwsc');
var verticalText = converter.toVertical(inputText);    // 轉直書
var horizonText = converter.toHorizon(verticalText);   // 轉橫書
var halfwidth = converter.convert(fullwidth, 'half');  // 轉全形
var fullwidth = converter.convert(halfwidth, 'full');  // 轉半形

In Browser

<script src="https://raw.githubusercontent.com/imZack/Chinese-Writing-Style-Converter/master/cwsc.js"></script>
var verticalText = converter.toVertical(inputText);    // 轉直書
var horizonText = converter.toHorizon(verticalText);   // 轉橫書
var halfwidth = converter.convert(fullwidth, 'half');  // 轉全形
var fullwidth = converter.convert(halfwidth, 'full');  // 轉半形

API

#####.toVertical(String inputText[, integer height]) -> String #####.toHorizon(String handler) -> String #####.convert(String handler, 'full' | 'half') -> String

TEST

## 直書
*********************************
?所受勢他神上頭以,亦前他
 鼓過,一上罩,為抹都去不
 勵欺似文多著還是著出,自
 ,負也,有薄有他一去他禁
 這,有但些薄閒的縷了們地
 是被稍這緊的時同兩,偏踴
 什風遲是張寒間伴縷春不躍
 麼的緩所,煙,跟白五採地
 言歌,謂要,市在雲正用走
 語唱雖大損精街後,月,向

## 橫書
*********************************
他不自禁地踴躍地走向前去,他們偏不採用,亦都出去了,春五正月,抹著一縷兩縷白雲,
以為是他的同伴跟在後頭,還有閒時間,市街上罩著薄薄的寒煙,精神上多有些緊張,要損
他一文,但這是所謂大勢,似也有稍遲緩,雖受過欺負,被風的歌唱所鼓勵,這是什麼言語
?         
*********************************
## 全形轉半形
*********************************
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop
qrstuvwxyz{|}~
## 半形轉全形
*********************************
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH
IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop
qrstuvwxyz{|}~ 
*********************************

TODO

  1. 運用 NLP 來判斷直書橫書
  2. etc...