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

elf-help

v0.5.1

Published

Helper tools for advent of code, your very own helper elf

Downloads

236

Readme

Elf Help

Your very own helper elf; tools and functions to help with problems that may be encountered during advent of code.

Usage

All major features can be accessed through the default elf import:

import elf from "elf-help";

All major and minor features can also be accessed as named imports:

import { linesIntersect2D, ElfCartesianError } from "elf-help";

Features

Cartesian

| Feature | Description | | ------------------- | ------------------------------------------------------------------------------------- | | coord | Creates a coordinate object, either 2D or 3D | | coordinate | Clone of the coord function (only available through default import) | | isCoordinate2D | Verifies that an object is of the Coordinate2D type | | isCoordinate3D | Verifies that an object is of the Coordinate3D type | | line | Create a line object, either 2D or 3D | | isLine2D | Verifies that an object is of the Line2D type | | isLine3D | Verifies that an object is of the Line3D type | | linesIntersect2D | Checks if 2 lines intersect in a 2D plane (3D lines can be evaluated on the xy plane) | | ElfCartesianError | Error thrown by cartesian features |

| Type | Description | | -------------- | ---------------------------- | | Dimention2D | The dimentions of a 2D space | | Dimention3D | The dimentions of a 3D space | | Coordinate2D | A 2 dimentional coordinate | | Coordinate3D | A 3 dimentional coordinate | | Line2D | A 2 dimentional line | | Line3D | A 3 dimentional line |

Fraction

| Feature | Description | | ------------------- | ------------------------------------------------- | | new Fraction | Creates a new Fraction object | | fraction | Clone of new Fraction | | Fraction.add | Adds together two fractions | | Fraction.subtract | Subtracts two fractions | | Fraction.multiply | Multiplies together two fractions | | Fraction.divide | Divides two fractions | | Fraction.value | Returns the number representation of the fraction |

Iterate

| Feature | Description | | -------------- | --------------------------------------------------------------------------------- | | permutations | Returns all permutations of a list, optionally limited to n-length permutations | | combinations | Returns all combinations of a list, optionally limited to n-length combinations | | rotate | Returns all copy of an array rotated n steps |

Math

| Feature | Description | | -------------------- | ---------------------------------------------------------------------------------- | | sum | Returns the sum of all provided numbers | | product | Returns the product of all provided numbers | | gcd | Finds the Greatest Common Divisor of two numbers | | lcm | Finds the Lowest Common Multiple of two numbers | | factorial | Returns the factorial of a number | | divisors | Returns all divisors of a positive integer | | new Matrix | Creates a new Matrix object | | matrix | Clone of new Matrix | | Matrix.get | Gets the element of the matrix for a given x and y | | Matrix.isSquare | If the matrix width is equal to the height | | Matrix.validate | Validates that the matrix has the same width for all rows (i.e. is a valid matrix) | | Matrix.determinant | Finds the determinant of a square matrix | | ElfMathError | Error thrown by math functions | | ElfMatrixError | Error thrown by matrix functions |

Range

| Feature | Description | | ---------------- | -------------------------------------------------------------------------------------- | | new Range | Creates a new Range object | | range | Clone of new Range | | Range.size | The number of elements included in the range | | Range.size | The number of elements included in the range | | Range.contains | Checks if a number or Range is within the range | | Range.overlaps | Checks if a Range overlaps with the range | | | Can optionally return a detailed object with what's contained and outside of the range | | ElfRangeError | Error thrown by range functions |

Parse

| Feature | Description | | -------------- | ----------------------------- | | parseNumbers | Finds all numbers in a string |