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

opencc-clip

v0.1.1

Published

Conversion between Traditional Chinese and Simplified Chinese in clipboard

Downloads

32

Readme

OpenCC - Clipboard

A command line tool to do a conversion between Traditional Chinese and Simplified Chinese in clipboard, based on OpenCC

命令行工具,可將剪貼簿中的繁體中文與簡體中文進行轉換,節省複製貼上的時間。基於 OpenCC 進行開發。

Install

npm install opencc-clip -g

Usage - Command Line

複製一段文字到剪貼簿中

在命令行,執行

s2t

可將剪貼簿中的文字從簡體中文轉換為繁體中文

執行

t2s

可將剪貼簿中的文字從繁體中文轉換為簡體中文

Usage - Alfred Workflow

  1. Install opencc-clip in global (npm install opencc-clip -g)
  2. Download workflow and install in Alfred
  3. keyword: t2s to convert Tranditional Chinese to Simplified Chinese in clipboard
  4. keyword: s2t to convert Tranditional Chinese to Simplified Chinese in clipboard

If you use nvm, free feel to update the script directly


Full Feature - Convert File content (t2s or st2) into Clipboard


s2t -i file.txt

可將 file.txt 的內容,從簡體轉換成繁體後,貼到剪貼簿

Full Feature - Convert Cipboard content (t2s or st2) to generate File


t2s -o file_output.txt

可將剪貼簿的內容,從繁體轉換為簡體後,生成file_output.txt

Full Feature - Conversion between files

s2t -i file.txt -o file_output.txt

Full Feature - Specific Dictionary

OpenCC除了t2s跟s2t之外,還支持不同的字典檔,可參考 https://github.com/BYVoid/OpenCC 已獲取所有支持的字典檔列表

透過以下方式指定字典檔,如:

opencc-clip -d tw2sp

則可將繁體(臺灣正體標準)到簡體並轉換爲中國大陸常用詞彙

Full Feature - Node.js Usage

同時也支持Node.js進行二次開發

const openccClip = require('opencc-clip')

openccClip(
  {
    input: 'foo', /* input file name,如果省略則從clipboard獲取內容 */
    output: 'bar' /* output file name,如果省略則輸出到clipboard */
  },
  's2t' /* OpenCC 支持的字典檔名稱 */
)

Issues

Free feel to open an issue if any bug found