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

@ksfcore/dyeing

v2.0.1

Published

KSF 染色基础模块

Downloads

12

Readme

@ ksf / dyeing

The KSF dyeing basic module provides methods for obtaining and judging staining objects.

Users: You should not use this module directly, but use other modules that meet the staining standards to obtain staining objects

Module developer: Get KSF stained objects You should use this module's gen() method to get colored objects

Dyeing (Introduction)

Coloring is a state passed on the interface's invocation chain (server <==> client) to identify a specific request processing process.

This state consists of a flag and additional information KEY _ (optional) _.

Services on the call chain can set (originate) and read (receive) this state, and perform corresponding processing (such as outputting specific logs and characteristics).

In the system, dyeing consists of this module and its corresponding convention.

Standard (Convention)

If the module uses a dyeing system, it is necessary to comply with the following conventions (At the same time, we will refer to the modules that meet the conventions as the modules that meet the staining standards):

  1. Provide the getDyeingObj() method and return Dyeing Object.
  2. Use the @ ksf/dyeing.gen method to generate a dyeing object.
  3. Use the @ ksf/dyeing.is() method to determine whether the dyeing object is valid.

Module method

KsfDyeing.gen (dyeing [, key, args])

By calling this method, you can get colored objects:

dyeing: Do you need dyeing key: Coloring additional information KEY (optional) args: additional parameters of the program (optional)

key is passed to the next service through the call chain, while args is only valid in the current dyed object (it is not passed).

Please note: The cause of the staining is different from the cause of the staining (thing). This module only cares about the stained objects, not the cause of the staining.

KsfDyeing.is(obj)

Call this method to determine whether an object passed in is a colored object:

If an empty object is passed in, the method will also return false

Dyeing Object Properties

dyeingObj.dyeing

Whether coloring is required, this is Boolean

dyeingObj.key

Additional information passed by the dye, this is String and is optional and may not exist

dyeingObj.args

Additional information about the dyed object itself, which should not be passed between services by business code (only used as a local parameter).

This object is not limited in type and is also optional