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

webpack-npm-version-plugin

v2.0.0

Published

[![NPM version][npm-image]][npm-url]

Downloads

7

Readme

webpack-npm-pgk-version-plugin

NPM version

一、简介

在团队合作开发时,项目中可能需要使用到一些二方库,当我们在更新项目代码时,其他协作方可能更新了部分包的版本,

且新更新下来的代码会依赖这些包,由于使用webpack打包时这些异常并不会提示,在运行时才发现错误,且排查下来才知道需要更新哪些包,

所以使用此工具检测协作者设置包版本说明文件,来提醒当前更新代码的开发者需要重新安装哪些包。

二、安装

npm install webpack-npm-pgk-version-plugin --save-dev

三、使用

Webpack 简单配置

const WebpackNpmPgkVersionPlugin  =require('webpack-npm-version-plugin');

module.exports = {
  context:appjsRoot,
  entry: {
    'app': ['./app.js']
  },
  output: {
    filename:  '[name]',
    chunkFilename:'[name]',
    libraryTarget: 'commonjs2'
  },
  plugins:[
    // 默认会读取项目根目录下的 .npm-version.json 文件来对比
    new WebpackNpmPgkVersionPlugin()
    // 或者通过传入配置文件路径指定要使用哪个版本配置文件
    // new WebpackNpmPgkVersionPlugin('/user/xxx/npm-verion.json')
  ]
}

关于 .npm-version.json

默认会读取项目启动根目录下的.npm-version.json来作为依据判断哪些库需要提醒协作者升级

[
 {  "name":"mylib","minversion":"1.5.2","description":"请更新mylib到1.5.2由于需要使用该版本的.add函数" }
]

四、开源许可

基于 MIT License 开源,使用代码只需说明来源,或者引用 license.txt 即可。