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

basiclibrary.javascript

v1.2.4

Published

a JavaScript class library

Downloads

123

Readme

企业级的 JavaScript 类库

@project: basiclibrary.js
@creator: ShanDong Xiedali
@emailto: [email protected]
@company: HiLand & RainyTop

特别说明:本项目不再维护,所有功能已经迁移到 basiclibrary.ts 项目中,请移步使用。 安装basiclibrary.ts命令为:pnpm install basiclibrary.ts

文档组织说明

  1. 本项目大部分类库采用函数库的方式,是函数式编程思想的体现
  2. 本项目使用 WebStorm 打开进行编辑
  3. jQuery-Plugin 是 jQuery 的插件库,仅 Web 类型的项目可用
  4. miniApp 是微信等职能小程序可以使用的功能
  5. .demoPages 是手工测试页面的目录;.test 是单元测试测试框架自动测试的目录。
  6. data、utils 等各个目录是本项目的类库功能区域

产品发布说明

  1. 打开 package.json 找到 version 进行修改
  2. 提交并推送代码到 github
  3. 打开终端窗口,执行 npm publish

项目使用说明

本类库兼容 commonjs 和 module(ES)

  1. 目标项目如果采用 CommonJS 方式组织代码,调用的时候在 package.json 内请配置 "type": "commonjs",引用类库的方式如下
const oh = require("../utils/objectHelper");

如果是 Inject 类型的文件,引入方式可以简化为

require("../utils/objectInjector");
  1. 目标项目如果采用 module 方式组织代码,调用的时候在 package.json 内请配置 "type": "module",引用类库的方式如下
import {helper as hh} from "../utils/htmlHelper.mjs"

如果是 Inject 类型的文件,引入方式可以简化为

import {} from "../utils/stringInjector.mjs";

通过 import 导入的文件必须含有文件名扩展符 ".mjs"

  1. 在HTML页面中调用,需要使用 webpack 配合,使用的大概流程如下:
    1. 在 HTML 中新建立一个 js 文件(假定名称为 main.js),类似如下
    const ah = require("basiclibrary.javascript/utils/arrayHelper");
    const nh = require("basiclibrary.javascript/utils/numberHelper");
    const jQuery = require("jquery");
       
    let all = {nh, ah};
       
    window.$bl = all;
    window.$ = jQuery;
    1. 用webpack转换这个 main.js 为 bundle.js
    2. 然后再HTML页面引用这个 bundle.js
    3. 在HTML页面内可以通过 $bl 继续使用包含的类型和方法