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

ztrings

v1.1.6

Published

String templating built for your string-based needs

Downloads

23

Readme

logo

ztrings :zap: is a small opiniated string template package built to enable convenience and flexibility for you string-based needs, featuring:

  • Strings color styling in node and in the browser (using ASCII code escapes)
  • String pluralization using simplur
  • Prettify strings in source code using compress-tag

Getting started

ztrings is hosted on npm, so you can install it with:

npm install ztrings --save
yarn add ztrings --save

Dependencies

Examples

For usage of each package functionaly head to their corresponding Examples section

import { z } from 'ztrings';

console.log(z`
    I have ${21} color[|s]\N

    {bright bright}\N
    {dim dim}
    {underscore underscore}\N
    {blink blink}
    {reverse reverse}\N
    {red red}
    {green green}\N
    {yellow yellow}
    {blue blue}\N
    {magenta magenta}
    {cyan cyan}\N
    {white white}
    {bgBlack bgBlack}\N
    {bgRed bgRed}
    {bgGreen bgGreen}\N
    {bgYellow bgYellow}
    {bgBlue bgBlue}\N
    {bgMagenta bgMagenta}
    {bgCyan bgCyan}\N
    {bgWhite bgWhite}
    {bgRed dim Test}\N
`);

Contributing

If you have a particular use case, shoot your issue/PR and I'll do my best to help and improve zstrings for all of us to enjoy :) Also you can take a look at the roadmap below of some of the bullet points I consider would be a great enhancement for the package

Roadmap

  • [x] Compress in one package many strings utility functions
  • [x] Custom coloring prettify functionality
  • [x] Find a way to escape line breaks at will (achieved using custom escape character \N)
  • [ ] Add support for tabs \t
  • [ ] Escape line breaks using the conventional \n (not sure if possible)
  • [ ] Make the z function configurable, pass as flags the transformation functions
  • [ ] Allow for custom transformation functions
  • [ ] Add unit tests to make more maintainable the project
  • [ ] Build a website that showcases the functionality of zstrings
  • [ ] Write documentation regarding how performant the z function is
  • [ ] Make sure xss is not possible using this package
  • [ ] Write CONTRIBUTING.md file to make contributors welcome

Folder structure

folder structure