New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

spirits

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spirits

A glob/wildcard matching library

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
3
-50%
Maintainers
0
Weekly downloads
 
Created
Source

spirits

Get the spirit of a string, without the whole thing!

A glob/wildcard matching library.

I know there are already a lot of these, but I had a use case that required testing a string against many wildcards and determining which matched most specifically. I couldn't find one that did that, so I just made my own. (If you would like that same functionality, look for the bestMatch function.)

Usage

import Spirit from "spirits";

const format = new Spirit("The weather is * today!");
const greeting = "The weather is great today!";

console.log(
	format.match(greeting)
		? greeting
		: "I have no idea what the weather is like because I am just a computer!",
);

FAQs

Package last updated on 16 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts