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

nano-jssv-check

v1.0.1

Published

a library package to detect or check js simple value type in js runtime

Downloads

7

Readme

一个类库包,用于在 js 运行时中 判断/校验 js 原生值类型

文件大小

file | size | gzip | brotli :---- | :---- | :---- | :---- dist/main.cjs | 0.88kb | 0.46kb | 0.38kb dist/main.js | 0.75kb | 0.41kb | 0.33kb dist/main.min.cjs | 0.69kb | 0.41kb | 0.34kb dist/main.min.js | 0.57kb | 0.35kb | 0.30kb dist/main.umd.cjs | 1.24kb | 0.59kb | 0.49kb dist/main.umd.min.cjs | 0.82kb | 0.49kb | 0.41kb

~~备注: 带有 min 标志的文件未上传~~

项目背景

曾经完成过这样的一个需求:需要从将用户的文本值转换为 js 原始值。那么, 转换后的 js 原始值 要不要校验 ?

当前功能

  • 在 js 中 判断/校验 js 原生值类型

用户安装

  • 您可以通过npm cdn 直接引入
<!-- unpkg.com/:package@:version/:file -->
<!-- unpkg.com/[email protected]/dist/main.js -->
<!-- jsdelivr -->
<!-- unpkg.zhimg.com -->
  • 您可以通过类库安装工具安装
npm i nano-jssv-check
yarn add nano-jssv-check
pnpm add nano-jssv-check
import {jssvcheck} from 'nano-jssv-check'
jssvcheck(true, "boolean")

import {StrvParse as strvparse} from 'nano-strv-parse'
const strvparsesafe = (value:any,type:string,desc?:any) => {let result=strvparse(value,type);if(!jssvcheck(result,type)){throw new Error(desc?desc:`expect ${result} to type ${type}`)};return result}

产品闭环

很小,功能单一,只做一件事—— 在 js 中 判断/校验 js 原生值类型

产品运维

因为功能简单,决定了它的开发速度,更新速度,问题速度不会很慢

产品计划

因为功能单一,功能已经基本完成,后期主要根据命令包或其他类库包的需要,更新小补丁,不会有功能大改的情况出现,架构可能会随着技术的更新而有变化

许可证书

您可以使用它做任何事,但是请不要违发您所在地区法律。我不会为您的行为承担任何责任。

结束语

身为一名程序员我很自豪,虽然足不出户,指尖却有着可以改变世界 (可能有点大了) 自己的力量。即使不能实现,将其作为努力的目标也不错。———— 摘自 lencx

它就是一张白纸,您有什么设想,可以直接编码出来,怎么编,规则怎么定,有您决定。