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 🙏

© 2026 – Pkg Stats / Ryan Hefner

lynk-utils

v1.0.3

Published

A utility library for data manipulation and calculations

Readme

Lynk Utils

A comprehensive TypeScript utility library for data manipulation, array operations, and object handling.

Installation

npm install lynk-utils

Features

  • Array manipulation and sorting
  • Object deep copying and merging
  • Data normalization and calculations
  • Type-safe utility functions
  • Full TypeScript support
  • Browser and Node.js compatibility

Usage

import { 
  normalizeTo100,
  addItem,
  mergeObjectValues,
  uuidv4
} from 'lynk-utils';

// Array normalization
const data = [
  { value: 30, name: 'A' },
  { value: 70, name: 'B' }
];
normalizeTo100('value', data);

// Adding items to array
const items = [];
addItem(items, { id: 1, name: 'Test' });

// Merging objects
const source = { a: 1, b: 2 };
const dest = { b: 3, c: 4 };
mergeObjectValues(source, dest);

// Generate UUID
const id = uuidv4();

API Documentation

Array Operations

addItem<T>(obj: T[], item: T, pos?: number, reset?: number): void

Adds an item to an array at a specified position.

const items = [];
addItem(items, { id: 1, name: 'Test' }, 0);

addMultipleItems<T>(obj: T[], n: number): void

Adds multiple copies of the first item in the array.

const items = [{ id: 1, name: 'Template' }];
addMultipleItems(items, 3);

Object Operations

getNewObject<T>(obj: T): T

Creates a deep copy of an object.

const original = { a: 1, b: { c: 2 } };
const copy = getNewObject(original);

mergeObjectValues<T>(src: T, dest: T, excList: string[] = []): void

Merges two objects, excluding specified properties.

const src = { a: 1, b: 2 };
const dest = { b: 3, c: 4 };
mergeObjectValues(src, dest, ['b']);

Data Manipulation

normalizeTo100(comp: string, masterList: any[], nameKey?: string, skip?: string, adjust: string = 'ALL'): void

Normalizes values in an array to sum to 100.

const data = [
  { value: 30, name: 'A' },
  { value: 70, name: 'B' }
];
normalizeTo100('value', data);

lynkRound(inp: number, p: number): number

Rounds a number to specified decimal places.

const rounded = lynkRound(3.14159, 2); // 3.14

Utility Functions

uuidv4(isNode: boolean = false): string

Generates a UUID v4 string.

const id = uuidv4();

strToHex(str: string): string

Converts a string to its hexadecimal representation.

const hex = strToHex('Hello'); // "48656c6c6f"

Browser Support

Most functions work in both Node.js and browser environments. Some functions like generateTable require jQuery and are browser-specific.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

GitHub Repository

https://github.com/Loosely-Coupled-Technology/lynk-utils

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any queries or support, please create an issue in the GitHub repository.