Skip to main content

A module containing general purpose utility functions

Works with
This package works with Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
This package works with Browsers
JSR Score
100%
Published
a month ago

A module containing general purpose utility functions

Examples

Slugify

import { slugify } from "@sillvva/utils";

const slug = slugify("Hello World");
console.log(slug); // hello-world

Sorter

import { sorter } from "@sillvva/utils";

const arr = [3, 1, 2];
const sorted = arr.sort(sorter);
console.log(sorted); // [1, 2, 3]

const arrObjs = [{ id: 3 }, { id: 1 }, { id: 2 }];
const sortedObjs = arrObjs.sort((a, b) => sorter(a.id, b.id));
console.log(sortedObjs); // [{ id: 1 }, { id: 2 }, { id: 3 }]
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @sillvva/utils

Import symbol

import * as mod from "@sillvva/utils";

Add Package

npx jsr add @sillvva/utils

Import symbol

import * as mod from "@sillvva/utils";

Add Package

yarn dlx jsr add @sillvva/utils

Import symbol

import * as mod from "@sillvva/utils";

Add Package

pnpm dlx jsr add @sillvva/utils

Import symbol

import * as mod from "@sillvva/utils";

Add Package

bunx jsr add @sillvva/utils

Import symbol

import * as mod from "@sillvva/utils";