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

@deepexi-devops/utils

v0.0.9

Published

> TODO: description

Downloads

39

Readme

@deepexi-devops/utils

一个服务于 devops 项目的通用工具函数库

安装

yarn add @deepexi-devops/utils

使用

import { formatters } from '@deepexi-devops/utils'

const formatDate = formatters.formatDate(Date.now())
console.log(formatDate)

开发流程

  1. 当在微前端项目开发过程中需要使用工具方法时,可自行在原本项目中开发,当有必要作为公用方法处理时,可以clone本项目,进行开发
  2. 通过提 pr 或者 mr 的方式提交代码(引入 单元测试 测试后会有单元测试通过标准)
  3. 由维护者 review (引入 单元测试 测试后需要检验测试用例)
  4. 通过后再进行发包到 npm,之后需要更新的项目自行更新

规范

  1. 本模块默认使用 es 模块规范开发,打包出的模块也是只有 es 模块,目的为了配合其他打包工具更好配合 tree-shaking

  2. 本模块默认不导入第三方模块,若有引入第三方模块,请在 rollup.config.js 中 的 external 字段生命外部模块

计划

  • [] 引入单元测试

rollup 打包踩坑的一些记录

想学 lodash 按需引入方式比如

import cloneDeep from 'lodash/cloneDeep'

lodash 是一个方法打包成一个包,并且放在根目录,且只有一个默认导出

最后发现并不适合当前场景,当前场景需要的把函数分类存放到文件里,一个文件有多个导出

想去除 index.js 这个总入口文件,直接通过在src目录下创建文件就可以进行打包 在 rollup 下可以设置多入口,但是导出的 umd 和 iife 格式的文件无法进行代码分开

Error: UMD and IIFE output formats are not supported for code-splitting builds.

rollup 默认不会解析导入第三方库,需要导入需要用 @rollup/plugin-node-resolve 这个插件,否则就配置 external 字段证明这是外部模块

import * as sum from './sum'

这种写发并不能把 sum.js 下 export default 导出来

复习 https://es6.ruanyifeng.com/#docs/module#import-%E5%91%BD%E4%BB%A4