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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yanshouwang/core

v1.0.1

Published

Core Lib of TypeScript

Downloads

0

Readme

Core.TS

Node.js Package

Core Lib for TypeScript

介绍

EMMM...先介绍一下背景吧,一个被 C# 惯坏的程序员,最近被安排搞小程序,果断选择了 TypeScript,然鹅在蓝牙通讯的时候头大了,ArrayBuffer 是什么鬼东西 - -! 找了很久发现居然没有找到把数组通过 UTF-8 解码和编码的功能 (手动掀桌)

NPM 整个翻了一遍终于找到了 decode-utf8encode-utf8 这两个包,解决了这个棘手的问题

后来本强迫症想了下,不如把这些痛点的功能整合起来方便以后复用, 对自己也是个不小的提高。 于是就有了这个项目,哈哈哈,想的很多,不过目前只提供编码和解码的功能啦,以后再有需求再说吧~

安装

npm install --save @yanshouwang/core

使用

编码解码

目前支持 ASCII 和 UTF-8

编码

import { Codec } from "@yanshouwang/core";

// 准备数据
const str = "Hello, World!";
// ASCII
const codec = Codec.create("ASCII");
// UTF-8
// const codec = Codec.create("UTF-8");
const codes = codec.encode(str);

解码

import { Codec } from "@yanshouwang/core";

// 准备数据
const items = [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21];
const codes = new Uint8Array(items);
// ASCII
const codec = Codec.create("ASCII");
// UTF-8
// const codec = Codec.create("UTF-8");
const str = codec.decode(codes);

关于

  • 本萌新的本命语言是 C#,对于 TypeScript 的理解有限,有问题欢迎指正