New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

billd-utils

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

billd-utils

billd's utils

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
17
-29.17%
Maintainers
1
Weekly downloads
 
Created
Source

Billd-Utils logo

Billd-Utils

基于rollup + pnpm + esbuild搭建的Billd-Utils

简介

积累常用的 js 方法

安装

npm install billd-utils

文档

https://project.hsslive.cn/billd-monorepo/modules/utils.html

使用

该库尚未发布 1.0 版本,api 可能会随时发生变化,请勿用于生产环境!

import { isBrowser } from 'billd-utils';

console.log(isBrowser());

在浏览器使用

该库尚未发布 1.0 版本,api 可能会随时发生变化,请勿用于生产环境!

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      http-equiv="X-UA-Compatible"
      content="IE=edge"
    />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0"
    />
    <title>Document</title>
  </head>
  <body>
    <script src="https://unpkg.com/billd-utils/index.min.js"></script>
    <script>
      console.log(BilldUtils.isBrowser());
    </script>
  </body>
</html>

VSCode 提示

新建一个.d.ts 文件,如:billd-utils.d.ts(或者使用项目原有的.d.ts 文件),添加以下代码:

declare global {
  // eslint-disable-next-line
  import utils from 'billd-utils';
}

然后 vscode 里输入 billd-uitls 的方法,如 isBrowser,vscode 就会提示是否从 billd-utils 导入 isBrowser了~

本地调试

本地调试不会构建 umd

pnpm run dev

本地构建

pnpm run build

生成文档

使用 typedoc 生成,文档会生成在项目根目录的 doc 目录

pnpm run doc

发版

0.确保 git 工作区干净

即确保本地的修改已全部提交(git status 的时候会显示:nothing to commit, working tree clean ),否则会导致执行 release:local 脚本失败

1.执行本地发版脚本

pnpm run release:local

该脚本内部会做以下事情:

  • 根据用户选择的版本,更新 package.json 的 version
  • 开始构建
  • 对比当前版本与上个版本的差异,生成 changelog
  • 提交暂存区到本地仓库:git commit -m 'chore(release): v 当前版本'
  • 生成当前版本 tag:git tag v 当前版本

2.执行线上发版脚本

pnpm run release:online

该脚本内部会做以下事情:

  • 提交当前版本:git push
  • 提交当前版本 tag:git push origin v 当前版本
  • 发布到 npm

源码

https://github.com/galaxy-s10/billd-utils

Keywords

billd

FAQs

Package last updated on 09 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts