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

@kythuen/webpack-builder-utils

v3.0.7

Published

Utilities for webpack-builder

Downloads

5

Readme

@kythuen/webpack-builder-utils

webpack-builder-utils是为webpack-builder项目提供的工具库。所有与打包相关的通用工具函数都可以增加到此仓库中。

当前版本号:1.1.0

仓库地址:码云Gitee

使用方法

安装

yarn add -D @kythuen/webpack-builder-utils

使用

const { Log, Types, FileHelper } = require('@kythuen/webpack-builder-utils')

Log.done('打印成功日志')

const isObject = Types.isPlainObject({a: 1})

FileHelper.loadFileSync(...)

仓库模块介绍

Log

控制台打印日志,用于日志的统一化。

现支持的日志类型有:loginfodonewarnerror

函数使用方法: Log**[function] ([message],[tag])**

参数说明

  • message:日志内容
  • tag:日志的副标签

返回值:无返回

使用方法举例

Log.done('完成','tag标签')

Types

常用变量类型的判断。

现支持的判断的类型有:isStringisNumberisArrayisPlainObjectisFunctionisUndefinedisNull

函数使用方法: Types**[function] ([value])**

参数说明

  • value:要判断的变量

返回值:布尔值

使用方法举例

const isObject = Types.isPlainObject({a:1})

FileHelper

常用文件操作集合。

现支持的操作有:loadFileSync

函数使用方法: FileHelper**[function] ([filePath])**

参数说明

  • filePath:要加载的文件的路径,相对工作目录的相对路径或者绝对路径

返回值:文件加载的结果,包含加载状态status文件内容data

返回值说明

  • status === 0: 加载文件成功
  • status === -1: 加载文件异常,未找到文件
  • status === -2: 加载文件异常,找到文件但文件格式不对(此文件应该导出一个对象或一个返回对象的函数

使用方法举例

const content = FileHelper.loadFileSync(filePath)

规划功能

  • FileHelper中的loadFileSync函数,只能加载CommonJS规范的JavaScript文件。后面可能修改函数名为类似FileHelper.commonjs.loadJSFileSync
  • FileHelper中补充loadFile函数:异步加载JavaScript函数。

代码提交

使用前请先安装提交相关的开发依赖,全局或局部安装

yarn add -D commitizen cz-conventional-changelog conventional-changelog-cli replace standard-version