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 🙏

© 2025 – Pkg Stats / Ryan Hefner

winning-cookie-webpack-plugin

v1.0.0

Published

write cookies for part of win6.0 project

Downloads

14

Readme

winning-cookie-webpack-plugin

功能描述

针对Win6.0项目中,各小组前端项目没有登录页面,导致每次开发必须去测试环境登录获取token和userInfo信息,手动写入cookie,不利于开发工作。 故写此插件。只需传入相关参数即可在webpack构建时发请求获取信息自动写入相关cookie。

使用方法

安装

yarn add winning-cookie-webpack-plugin --dev

vue.config.js中加入

const WinCookiePlugin = require('winning-cookie-webpack-plugin')

module.exports = {
  chainWebpack: (config) => {
    config.when(process.env.NODE_ENV === 'development', config => {
      config.plugin('WinCookiePlugin').use(WinCookiePlugin,[{
          userInfo: {
            loginURL: 'xxxx', // 登录地址URL
            userInfoURL: 'xxxx', // 获取用户信息URL
            username: 'xxx', // 登录用户名
            password: 'xxxx' // 登录密码
          },
          extraCookies: {}
      }])
    })
  }
}

浏览器效果:

参数说明

| Param Name | Required | Type |Description | |--------|----------|--------|-------| | userInfoParams | 可选 | Object | |获取token和登录用户信息字段,不传时使用默认参数 | | userInfoParams.loginURL | 当传入userInfoParams时必须 |String | 登录地址URL | | userInfoParams.userInfoURL | 当传入userInfoParams时必须 |Stirng | 获取用户信息URL | | userInfoParams.username | 当传入userInfoParams时必须 |String |登录用户名 | | userInfoParams.password| 当传入userInfoParams时必须| String |登录密码 | |extraCookies| 可选 | Object|需要写入的额外cookies对象|

注意:当传extraCookies字段时会根据其默认值进行merge操作

注意事项

目前的策略是当且仅当登录接口和用户信息接口返回成功才写入所有cookie。