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

staquia

v0.3.4

Published

The best library for tables and lists.

Downloads

6

Readme

Staquia

This is a configurable lexicographic position based algorithm, used to get the core, next or previous number for a nth base number system. This project was created with the intention to solve the reinsertion and sorting problem when using long lists.

To have a full detailed explanation you can go to the documentation site.

You can install with all its dependencies as below.

  npm install guardex, staquia --save-dev

Or use it from the unpkg cdn as a simple script tag via the browser to have it as a global object named staquia.

<script src="https://unpkg.com/[email protected]/umd/index.js"></script>
<script type="module">
  console.log(staquia); // Now can be used globally in the HTML app
</script>

Note: As umd must contain only one default exported object, all named imports (like symbol) are contained within the global object staquia.

All of the examples in this document uses ECMA syntax to import or export code from the library, but this supports CommonJS syntax as well.

// ECMA Syntax
import staquia from "staquia";

// CommonJS Syntax
const { staquia } = require("staquia");

// Some libraries will support conditional imports poorly
// or not even support it.
// For these cases you can force the imports like below.

// For ECMA Scripts
import staquia from "staquia/esm";
// For CommonJS Scripts
const { staquia } = require("staquia/cjs");
// For browser applications UMD
import * as staquia from "staquia/umd";
const staquia = require("staquia/umd");

Settings

You can pass as settings the options to create the best system that fits your needs.

import { staquia } from "staquia";

// This example has an 27th base number set [a - z]
staquia.setup({
  // z
  zero: "!",
  // sf
  first: "a",
  // s0
  last: "z",
  // kappa
  ϰ: 0.15,
  // `n` and `z`
  segments: {
    n: 5,
    z: 15,
  },
});

Note: All of the following examples are shown using the above system in the example.

Position

Is an object that represents a position that can be used either on on a table or a stack.

This contains functions to get the next, previous or even the core position that lays between this and another position.

The system from this position is based on a string that contains two sections, the n part and the z part.

This uses the property of string comparison where depending on the unicode number that represents the character, this may be bigger or smaller than other.

// Unicode \u0061 (61)
const a = "a";

// Unicode \u0062 (62)
const b = "b";

// Will print true as 61 < 62
console.log(a < b);

Section n

This section was designed with the sole purpose the to move up or down one position when the next or previous algorithm is used.

import { staquia } from "staquia";

// This example uses the 27th base number set [a - z]
const xy = staquia.position("xy");
const xz = xy.next();
// Prints - The following character is !!xz"
console.log("The following character is " & xz);

// This example uses the 27th base number set [a - z] with character zero as !
const b0 = staquia.position("b!");
const az = b0.previous();
// Prints - The previous character is !!az"
console.log("The previous character is " & az);

Section z

This section was designed with the sole purpose the to go to the mid value from two positions when the core algorithm is used.

import { staquia } from "staquia";

// This example uses the 27th base number set [a - z]
const a = staquia.position("a");
const b = staquia.position("b");

const am = a.core(b);

// Prints - The following character is !!!am"
console.log("The following character is ", am);

Above explains how the position systems works but there is more if you want to get the full power from this algorithm as mention in the beggining please visit documentation site.