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

between2

v0.2.0

Published

generate arbitary strings that sort between two strings. fork of between.

Downloads

6

Readme

between2 Build Status

between2 is fork of between

Usage

$ npm install --save between2

API

between(a, b)

const between  = require('between');
const tween = between('a', 'b');

//tween is a string that will sort between 'a' and 'b'.

a and b can be any string that does not end in the lowest character. this is like how there is only one number between 0 and 1 that ends in a "0".

NOTE: By default, the following characters are used to generate the string:

!0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~

after(a)

Generate string that sorts between a and between.hi.

before(a)

Generate string that sorts between between.lo and a.

trim(a)

Trim between.lo characters to the right of a.

strord(a, b)

Compares two strings, a and b, lexicographically. Returns 0 if a == b; -1 if a is lexicographically less than b; 1 if a is lexicographically greater than b.

randstr(len)

Generate random string with length len using chars. Expects len >= 0.

NOTE: The string's last character will never be either the between.lo character or the between.hi character for chars of size greater than two. This is intended so that this string, a, may be used as a reference point to generate strings that will be able to sort between a and any other string distinct from a. For chars of size 2, the between.hi character will be used.

inject(chars)

Create instance of between using characters from chars.

NOTE: It's expected that chars is at least 2 distinct characters long.

between.lo and between.hi

the top most string possible, and the lowest string possible. You must not be used as positions for items, because it will not be possible to insert items after or before them. These values represent the space infront of the first item, and the space between the last item.

Credit

Cheers to @dominictarr who created the original between module.

License

MIT