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

@sedd/utils

v3.2.2

Published

SEDD specific utilities that are common between client/server.

Downloads

36

Readme

Sedd Utils

SEDD specific utilities that are common between client/server.

Install

npm i -S @sedd/utils

Utils

This module provides the following utilitys

Progress

Progress is a simple data object ({ distance, diameter }) as recorded in the field. An array of progress objects is used to create the drill's segment status.

toVolume

Converts a progress object (distance in feet, diameter in inces) to volume (cubic yards). Note, it performs raw volume calcuation and does not account for over-drilling.

import { toVolume } from "@sedd/utils/progress";

toVolume({ distance: 100, diameter: 30 });

Segment

A segment is a link-list data structure which models the excavation state of a drill. A linked list is needed to properly perform segment math as new progress objects are added.

fromProgressArray

Converts an array of progress objects into a segment linked-list.

import { fromProgressArray } from "@sedd/utils/segment";

const segment = fromProgressArray([
  { diameter: 30, distance: 100 },
  { diameter: 30, distance: 100 }
])

toArray

Converts a segment linked-list into a segment array: an array of progress objects which have been properly added to each other based on business logic of how to properly sum progress objects.

import { toArray, fromProgressArray } from "@sedd/utils/segment";

const segment = fromProgressArray([
  { diameter: 10, distance: 100 },
  { diameter: 30, distance: 100 }
]);

const holeStatus = toArray(segment); // produces [{diamter: 30, distance: 100}]

toVolume

Converts a segment linked-list into total extracted volume.

import { toVolume, fromProgressArray } from "@sedd/utils/segment";

const segment = fromProgressArray([
  { diameter: 10, distance: 300 }
  { diameter: 20, distance: 780 }
]);

const volume = toVolume(segment); // produces 63.025778544239685

addProgressObject

import { addProgressObject, fromProgressArray } from "@sedd/utils/segment";

const segment = fromProgressArray([
  { diameter: 10, distance: 300 }
  { diameter: 20, distance: 780 }
]);

const progress = { diameter: 30, distance: 780 };

addProgressObject( segment, progress );

UUID

A set of functions to create deterministic UUIDS based on legacy or VP ids.

import {
  fromLegacyRigId
  fromLegacyUserId
  fromLegacyContractId
  fromLegacyDrillId
  fromLegacyPhaseId
  fromLegacyShiftId
  fromLegacyPhaseProgressId
  fromLegacyShiftEventId
  fromLegacyTimeCardId
  fromVpEmployeeId
  fromVpContractId
  fromVpDrillId
  fromVpPhaseId
} from "@sedd/utils/uuid";

fromLegacyRigId(4);

Dates

Commonly used date utilities.

import {
  minDate,
  maxDate,
  formatDateNoTime
} from "@sedd/utils/dates";

const min = minDate(null, new Date(), new Date(), new Date());
const max = maxDate(null, new Date(), new Date(), new Date());
const dateInYYYYMMDD = formatDateNoTime(new Date());