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

lingascript-cn

v0.3.0

Published

LingaScript is TypeScript that support Simplified Chinese keywords

Downloads

1

Readme

LingaScript-cn

LingaScript-cn 是支持简体中文关键字的 TypeScript 编译器。语法衍生自 TypeScript (和 Javascript)。

LingaScript-cn 可以将以简体中文撰写的脚本编译成 Javascript,可在任意支持Javascript的环境中执行。

欢迎探索非英语编程语言 的朋友一同参与,我们可以通过改进共用的核心,來提供更好用的非英语编程语言工具。具体请查看LingaScript源码库

Non-english programming adventurers can easily add your local language, work together to improve the same core, and get benifit for the shared programming tools with better local language support. Check out the LingaScript repo.

支持的本地语言

LingaScript-cn 支持简体中文与英文关键字(Keywords),要支持別的语言需分別安裝不同套件。

使用说明

可使用npm命令安裝 LingaScript:

npm install -g lingascript-cn

安裝后可得到tsc命令. (和TypeScript相同)

建立测试.ts文件如下

变量 一切 = 假的;

或加上 TypeScript 声明

变量 一切:真假 = 假的;

然后使用以下命令编译

tsc 测试.ts

则会输出测试.js

var 一切 = false;

LingaScript 支持所有 TypeScript 编译器的命令,所以也可以用如下指令

tsc examples/cn/src/测试.ts --outFile test.js

测试.ts输出成test.js

To show with locale diagnostic messages, pass the --locale [lang] param in tsc, ex: 要显示中文的错误信息,可以在运行tsc命令时加上--locale zh-tw参数, 如:

tsc --locale zh-cn test.ts

更多范例可参考 https://github.com/gasolin/lingascript/tree/master/examples/cn .

本地安裝 (而非全局安裝)

先创建源码文件夹,并安裝 lingascript-cn

$ mkdir demo && cd demo && npm init
$ npm install lingascript-cn

编辑package.json加入以下设置,并更新 lingascript-cn 版本号

"scripts": {
  "compile": "./node_modules/lingascript-cn/bin/tsc 测试.ts"
},
"devDependencies": {
  "lingascript-cn": "^0.2.0",
},

即可在源码中使用中文关键字开发程序,使用npm run compile进行编译。

版本历程

查看 https://github.com/gasolin/lingascript/blob/master/CHANGELOG.md

授权

Apache-2.0 License