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

miao-lang

v1.0.5

Published

A language of Miao.

Downloads

4

Readme

喵语言(Miao-lang)

这是一个可以将人类语言翻译为喵语言的程序。

在线演示:https://miao-lang.com

特性

  • 可以将任意文本转为由若干“喵”组成的喵语言,且这个过程是可逆的
  • 支持网页、微信等常见应用,将喵语言复制到这些应用并发送不会损失信息

安装

npm install miao-lang

使用方法

import Miao from 'miao-lang'

let human_msg = 'Hello 喵星人!'
let miao_msg = Miao.encode(human_msg)

console.log(miao_msg) // 喵​‍‍‌‌‌​‌‍‍‌‌​‍‍‌‍‍​‍‍‍‌​‍‌‍​‌‍‍‌‌​‌‍‌​‌‌‍‌​‍‍喵​‍‍‍‍‍​‍‌‌​‍​‍‍​‍‌‍‍​‌‍‌‌​‌‌‌‍​‍‍​‍‌‌‌‍​‍‍‌‌​‌喵‌‌​‌‌‍​‌‌‍​‌‌‍‌‌​‌‌‍‍‍喵。

let msg2 = Miao.decode(miao_msg)

console.log(msg2) // Hello 喵星人!
console.log(msg2 === human_msg) // true

API

  • Miao.encode(t: string, options?: Human2miaoOptions): string 将普通文本转为喵语言
  • Miao.decode(t: string): string 将喵语言转为普通文本
  • Miao.isMiao(t: string): string 判断输入的文本是否为喵语言

Types

  • Human2miaoOptions
    • calls: string 动物叫声, 如: , ,
    • halfwidthSymbol: boolean 是否使用半角符号,如,.?!

多种族化

示例:

import Miao from 'miao-lang'

let human_msg = 'Hello 鸽子精!'
let gu_msg = Miao.encode(human_msg, { calls: '咕' })

console.log(gu_msg) // 咕咕咕咕。

国际化

示例:

import Miao from 'miao-lang'

let human_msg = 'Hello Guys.'
let msg = Miao.encode(human_msg, { calls: 'Meow ', halfwidthSymbol: true})

console.log(msg) // Meow ​‍‍‌‌‌​‌‍‍‌‌​‍‍‌‍‍​‍‍‍‌​‍‌‍​‌‍‍‌‌​‌‍‌​‌‌‍‌​‍‌Meow ‍‍‍​‌‍​‍‍‌‍‍​‍‍​‍‍‌​‌‌‍‌‌​‍‌​‌‌‌‌‍‌Meow .

工作原理

喵语言本质上是一种文本编码、解码算法,其原理为使用零宽字符将原文编码,并隐藏于若干“喵”之中。目前版本中所用到的零宽字符有 \u200b\u200c\u200d

其中编码流程如下:

  1. 生成 Base64 字符与零宽字符的对照表;
  2. 将原文转为 Base64 编码;
  3. 使用对照表将 Base64 编码后的内容转为由零宽字符组成的不可见的新编码;
  4. 根据一定规则,在新编码的最前、最后以及中间位置,插入若干“喵”以及标点符号;
  5. 完成。

解码过程则是以上流程的逆运算。

最后

本项目纯属娱乐,祝大家玩得开心! 愿喵之力与你同在!