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

cheesestrings

v1.2.0

Published

A few additional methods for String objects

Downloads

5

Readme

cheeseStrings

A couple of handy string methods, my first npm package

Installation:

npm install cheesestrings

Use:

String.capitalize() : capitalizes first character of a string:

"my string".capitalize()
// "My string"

String.toTitleCase() : capitalizes first character of every consecutive string of characters separated by a space:

"my other string".toTitleCase()
// "My Other String"

Neither method will have any effect on any other character:

"my stRING".capitalize()
// "My stRING"

"my otHER strinG".toTitleCase()
// "My OtHER StrinG"

String.alternateCaseWord() : alternates the case of a word. If first character in string is uppercase A-Z, first character of result will be uppercase, else it will start lowercase:

"string".alternateCaseWord()
// "sTrInG"

"Another".alternateCaseWord()
// "AnOtHeR"

String.reverse() : reverses a string:

"my other string".reverse()
// "gnirts rehto ym"

String.BEMinate(PMS=true, breakChar="\\|") : converts a string to a BEM style structure:

"block identifier | element selector | modifier class".BEMinate()
// "block-identifier__element-selector--modifier-class"
  • Accepts two optional arguments:

    • PMS : prepended multiple selector, i.e. adds a period (.) character before the string.

    • breakChar : string used as break character, can be multiple characters. Regex special characters must be escaped with \\.

      "block |identifier| ||| element |selector| ||| modifier class".
        BEMinate(true, "\\|\\|\\|");
      // ".block-|identifier|__element-|selector|--modifier-class"

Contributions

At this time, I am working alone on this package. This section will be updated in due course.

Bugs / Features

Please raise bugs via this bug issue form.

Please raise new feature requests via this feature request form.

In due course, I aim to generate query forms and documentation forms, but for now, they will need to be submitted as blank issues. Please add relevant labels!

Acknowledgments

Big thanks to @SuzyBee1987 for inspiring me to create this. I realize there are other packages out there that may do similar things, but over time I hope to build up a library of useful String methods for all to use. Plus...it was quite good fun!