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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sku-processing

v1.0.2

Published

sku简单处理数据,简单帮你处理好你的sku数据

Readme

sku-processing

#sku简单数据处理

##简单的处理多规格筛选数据具体业务根据处理好的数据来进一步操作

##多个下拉框联动

##下拉框联动也可以用这个方法来处理你想要的数据

$ npx install sku-processing

##具体使用方法

例子:
//整理好后端返回的数据成下面的
//可以选择的选项
const spec= [
    {title: "颜色", list: ["白色", "黑色"]},
    {title: "大小", list: ["S", "L",'XL']},
    {['youname']: "图案", ['youname']: ["圆", "正方", "三角",'椭圆']}
    ...
]
或者
const spec =  {
    color:["圆", "正方", "三角"],
    size:["S", "L",'XL'],
    ['youname']:["圆", "正方", "三角",'椭圆']
    ...
}
...
//这个是后端返回的库存组合
var inventoryOptions = [
    {id: "1", invOpt: ["白色", "S", "圆"]},
    {id: "2", invOpt: ["白色", "S", "正方"]},
    {id: "3", invOpt: ["白色", "S", "正方"]},
    {id: "4", invOpt: ["黑色", "S", "正方"]},
    {id: "5", invOpt: ["白色", "S", "三角"]},
    {id: "5", invOpt: ["白色", "L", "椭圆"]},
    {id: "6", invOpt: ["黑色", "XL", "正方"]},
    {id: "9", [youname]: ["白色", "S", "正方"]
    ...
  ]
...

然后调用本方法

import tabulationMatrix  from 'sku-processing'

//初始化

var a = new tabulationMatrix(spec,inventoryOptions)

//这里是每选一个就要调用一次(你选择的规格),可以放在监听里面,初始化选择都是空数组

var Selected = Array(spec.length).fill("");//可用于当前规格是否被选

var b = a.getSpecArray(Selected);  

console.log(b)
//得到当前可以选择的数据用于页面渲染判断
//(8) ['白色', '黑色', 'S', 'XL', '圆', '正方', '三角', '椭圆']

...

Selected = ['白色','S','']

var c = a.getSpecArray(Selected);

console.log(c)

//['白色', 'S', '圆', '正方', '三角']