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

zingutilsinstall

v1.0.5

Published

zingUtils安装的rollup插件

Downloads

3

Readme

:::warning zingUtilsInstall:一个rollup插件,可在项目启动时,请求公司所有utils,并在项目中写入到一个ts文件中。 :::

介绍

使用axios请求公司zingUtils数据,获取全部源码,并将其组合入一个ts文件中。其中源码的import其他模块的部分会被解析,融合到ts文件顶部,且会屏蔽掉eslint监测,但不屏蔽Ts类型校验默认文件名:zingUtils.ts

参数

  • options:object 参数一个对象,对象内通过key来指定各项配置
    • run?:boolean 是否执行插件,默认True
    • path?:string 指定自定义目录放置TS文件,默认:src/utils/
    • include?:string[] 指定只引入哪些utils,默认全部引入
    • exclude?:string[] 指定排除哪些utils,默认不排除

一般来说,可以直接全部引入,若发现有的函数有bug,可以通过exclude来排除它,并通知对应开发者若想内容较少,只使用需要的。可以使用include

使用

export default defineConfig({
  plugins: [
    zingUtilsInstall({
      include:['hotBlock'],
    }),
  ]
})

注意事项和提议

:::danger 修改生成的ts文件里的函数,意义不大,因为每次启动项目,都会重新生成。除非你修改后,直接关闭了这个插件。使用已经生成的文件 :::

// bad 不要污染外部作用域
export function abc(){
  bc()
}
function bc(){
  
}
// good
export function abc(){
  bc()

  
  function bc(){
  
	}
}

// bad  不要any大法 要写注释

function a(b:any,c:any):void{
}
// good
/**
   * @description: 查看b和c
   * @param {string} b 一个b
   * @param {number} c 一个c
   * @return {*}
   */
function a(b:string,c:number):void{
}