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

selectively

v2.0.13

Published

Create selection by filtering a collection.

Downloads

3,369

Readme

template-library

Template for NPM library.

Selectively Grammar

Symbols

  • bool-expr (boolean expression)
  • prop (property, identifier (id) or combination of identifiers, e.g. identifier.identifier (id.id))
  • id (identifier)
  • expr (expression)
  • expr-op (expression operator e.g. >, <, >=, <=)
  • alg-expr (algebraic expression)
  • bin-op (binary operator)

Production Rules

Boolean Rules:

  • bool-expr -> prop ":" expr | prop expr-op expr | (bool-expr) | bool-expr "|" bool-expr | bool-expr bool-expr | !bool-expr
  • prop -> prop "." id | id
  • expr -> prop | string | alg-expr | (expr) | "!"expr | expr "|" expr
  • expr-op -> < | > | <= | >=

Algebraic Rules:

  • alg-expr -> number | alg-expr bin-op alg-expr | (alg-expr)
  • bin-op -> + | - | / | *

Merchant Rules

All id could be id.id.id...

Allowed Strings

id>num  
id<=str  
!(id:str)  
id:(str | str)  
id:((str | str) | str)  
(id<num)  
id:num  
id:!num  
id:!(num | num)  
id:(num | !num)  
id:id  
id>id  
(((id>num)))  
(id>(num))  
id.id:(id.id | str | num) | id.id.id:id.id  
id>num + num  
id<= num + (num * num) / num - num

Disallowed Strings

Open brackets:

(((id>num))

Mix of prop ":" expr and prop expr-op expr

id:(id>num)   

Special Rules

prop expr-op expr

Left-hand side:

Can be ambiguous, e.g. amount, where amount is an identifier which can be found as a property on several properties.

Right-hand side:

Can't be ambiguous, it must refer to a string, number or a unique identifier, e.g. "uniqueIdentifier.amount". An ambiguous identifier will be interpreted as a string. 

What is What?

  • 3.14 => number
  • identifier | identifier.identifier => property or properties
  • unique_identifier.identifier => property
  • .identifier => property if the identifier is a property of the base object, otherwise string.
  • 1.B2 => string
  • card.3d.secure => property
  • 20-12-24 => string
  • 20 - 12 - 24 => algebraic expression (uses whitespaces around the operators.)
  • "20 - 12 - 24" => string. ("" forces an)
  • Violation of the rules gives red underlining.