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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ctressa

v1.2.0

Published

assert lib use chinese to wrote

Readme

ctressa

simple chinese assert ^_^ (gagaga)

Usage

npm install ctressa
var hope = require("ctressa");
var 希望 = require("ctressa");

getter

  • length
var cases = HOPE([1, 2, 3, 4]).and([3, 3, 3]).length;
assert(cases.expected === 3, "a");
  • equal
  • 严格相等
HOPE("test").and("test").equal;
HOPE(4).and([1, 3, 4, 5].length).equal;
希望("test").和("test").严格相等;
  • abstractEqual
  • 抽象相等
HOPE(4).and("4").abstractEqual;
希望(4).和("4").抽象相等;
  • empty
  • 长度为空
HOPE([]).empty;
希望([]).长度为空;
  • PropertyLength
var cases1 = HOPE({ name: "zwkang" }).PropertyLength;
HOPE(cases1.ctressa).eq(1);
  • match
  • 相匹配
HOPE("test case").and(/test/).match;
希望("test case").和(/test/).相匹配;
  • strict
  • 严格
var testcase1 = HOPE({}).strict;
HOPE(testcase1.isStrict).ok;
var testcase1 = 希望({}).严格;
希望(testcase1.isStrict).为真值;
  • object
  • 对象
HOPE({}).is.object;
希望({}).是.对象;
  • ok
  • 为真值
HOPE(true).ok;
希望(true).为真值;

function

  • .ownProperty([key])
  • 拥有原型属性
HOPE({ name: "zwkang" }).ownProperty("name");
希望({ name: "zwkang" }).拥有原型属性("name");
  • .type()
  • 类型为
HOPE({}).type("object");
希望({}).类型为("object");
  • .haveProperty
  • 拥有属性
HOPE({ name: "zwkang" }).haveProperty("name");
希望({ name: "zwkang" }).拥有属性("name");
  • toThrow
var cases1 = function cases1() {
  throw new Error("toThrow test case");
};
HOPE(cases1).toThrow();
  • deepEql
  • 严格相等
var obj1 = { name: "zwkang", child: { name: "zhou", index: 1 } };
var obj2 = { name: "zwkang", child: { name: "zhou", index: 1 } };

HOPE(obj1).and(obj2).deepEql;
希望(obj1).和(obj2).不是.严格相等;
  • instanceof
  • 原型上存在
HOPE({}).instanceof(Object);
希望({}).原型上存在(Object);
  • contain
  • 包含
var obj1 = { name: "zwkang" };
var cases1 = [obj1, 2, 3, 4, 5];
HOPE(cases1).contain(obj1);
希望(cases1).包含(obj1);
  • eq
  • 相等于数字
HOPE(3).eq(3);
希望(3).相等于数字(3);

author

@zwkang

License

MIT