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

fsp-jschema

v1.3.0

Published

A JsonSchema validator written in TypeScript, compatible with both Nodejs and Deno.

Downloads

4

Readme

fsp.JSchema 说明文档

目的

解决 “泛JS” 生态下对 JSON 数据的格式校验问题,如以下场景:

  • 服务端接收客户端 post 来的数据,在处理之前需要先验证其是否符合 API 文档要求的规范,手写代码来检测是完全不可以接受的!
  • 前端拿到后端返回的数据,在进行 UI 渲染之前也需要检验是否符合预期,同样不能接受手写代码进行检测的方式。

它是用 TypeScript 写就的,优先适配 Deno 运行时,当然也可以编译成 JS,因此在 Nodejs 和 Web 前端环境下都可以完美运行。

你可能已经知道 JSON Schema 以及它的 JS 实现,如 ajvdjv 这些,的确 Deno.JSchema 解决的是一样的问题,但是这绝不是重复造轮子,其优势如下:

优点

  • 纯 TypeScript 开发,原生适配 Deno 运行时
  • 同时编译成 JS 版本进行发布,WEB 和 Nodejs 全支持
  • 轻量级、零依赖,拷贝即安装
  • 语义化强,好学好用

用法(TBD)