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

strio

v1.0.1

Published

Modern, lightweight & intuitive string utilities for JavaScript and TypeScript. Power your text. Simplify your code.

Downloads

63

Readme

strio — modern string utilities for JS/TS

strio is a modern, lightweight and predictable utility library for working with strings in JavaScript and TypeScript.
It focuses on minimalism, clean API and performance: only practical functions, no unnecessary magic.

  • Minimal: only functions that solve real everyday problems
  • Modern stack: ESM, CommonJS and full TypeScript types out of the box
  • Clean API: short names, predictable behavior

Install

npm install strio
# или
pnpm add strio
# или
yarn add strio

Documentation

Full documentation (EN + RU), examples and API reference:

  • Docs website: strio docs
  • Docs source: see the docs/ directory

Useful GitHub links:


Usage

ESM (Node.js ≥ 16 / bundlers / TypeScript):

import { join, template, slugify } from 'strio';

const title = join('Hello', { separator: ' — ' }, 'world'); // "Hello — world"

CommonJS (require):

const { join, template, slugify } = require('strio');

const url = slugify('Привет, мир!'); // "privet-mir"

TypeScript

strio ships with full TypeScript typings, no extra config required:

import { join, template } from 'strio';

const result = join('foo', 'bar'); // result: string

You can import only what you need (named exports only):

import { slugify } from 'strio';

Useful examples

join — smart string joining

import { join } from 'strio';

join('John', 'Doe'); 
// "John, Doe"

join('John', null, '', 'Doe'); 
// "John, Doe" (null and empty strings are filtered out)

join('Section', { separator: ' / ' }, 'Subsection', 'Page');
// "Section / Subsection / Page"

template — conditional templates via []‑blocks

import { template } from 'strio';

const name = 'John';
const age: number | null = null;

template`Hello, ${name}[ (${age} y.o.)]!`;
// age === null → "Hello, John!"
// age === 30  → "Hello, John (30 y.o.)!"

const dir = 'docs';
const file: string | null = null;

template`/${dir}[/${file}]`;
// file === null      => "/docs"
// file === "readme"  => "/docs/readme"

slugify — readable URL slugs

import { slugify } from 'strio';

slugify('Hello World!');        // "hello-world"
slugify('Привет Мир!');        // "privet-mir"
slugify('  Multiple   Spaces'); // "multiple-spaces"
slugify('café résumé');        // "cafe-resume"

// Кастомный разделитель:
slugify('Hello World', '_');   // "hello_world"

You can find more examples in the docs and in the tests/ directory.


Bug reports

Please open an issue on GitHub and include:

  • what you expected vs what you got
  • a minimal reproducible example
  • strio version, Node.js version and your bundler/environment

Issue templates live in .github/ISSUE_TEMPLATE:

👉 Create a new issue here: https://github.com/magic-b/strio/issues


Contributing

Pull requests and ideas are very welcome 🙌

Before starting a bigger change:

  • open an issue / draft PR to discuss the idea
  • try to follow the existing style and architecture
npm install
npm test
npm run build

For new functions:

  • add tests under tests/
  • add or update docs under docs/
  • document the change clearly in your PR description

See .github/CONTRIBUTING.md for the full contributing guide.