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

skaleb-string-utils

v0.5.1

Published

Simple string utilities provided in an easy to consume interface

Downloads

17

Readme

String Utils

NPM Version Build Status Quality Gate Status Bugs Code Smells Coverage

This package provides easy to use string utility functions that provide more functionality above and beyond normal string functions. These functions can be imported individually, without instantiation.

Installation

To install this package you can simply use the install command below.

$ npm i --save skaleb-string-utils

Usage

reverse(string) reverses and returns the given string.

import { reverse } from './index'

// gnirts emos
return reverse('some string')

capitalCase(string) capitalizes each individual word in a given string and returns the new string.

import { capitalCase } from './index'

// Some Or Other String
return capitalCase('some or other string')

camelCase(string) converts the given string to camelCaseFormat and returns it.

import { camelCase } from './index'

// thisIsNowCamelCase
return camelCase('This is now camel case')

toBinary(string, ?deliminate) converts the given string or sentence into binary code. This by default is returned as a single string however the response can be set to be deliminated.

import { toBinary } from './index'
import { Delimination } from './enums/Delimination'

// No delimination
// 1110011110111111011011100101100000110001011010011101110110000111100101111001
return toBinary('some binary')

// Space deliminated
// 1110011 1101111 1101101 1100101 100000 1100010 1101001 1101110 1100001 1110010 1111001
return toBinary('some binary', Delimination.SPACES)

// Retain original delimination
// 1110011110111111011011100101 110001011010011101110110000111100101111001
return toBinary('some binary', Delimination.ORIGINAL)

toHexadecimal(string, ?deliminate) converts the given string or sentence into hexadecimal. This be default is returned as a single string however the response can be set to be deliminated.

import { toHexadecimal } from './index'
import { Delimination } from './enums/Delimination'

// No delimination
// 68657861646563696d616c
return toHexadecimal('hexadecimal')

// Space deliminated
// 73 6f 6d 65 20 68 65 78 61 64 65 63 69 6d 61 6c
return toHexadecimal('some hexadecimal', Delimination.SPACES)

// Retain original delimination
// 736f6d65 68657861646563696d616c
return toHexadecimal('some hexadecimal', Delimination.ORIGINAL)

Tests

This project is completely covered by unit tests. Various cases have been accounted for both in the codebase and in the tests covering it. If a bug is picked up regarding the test suite or code, feel free to make a contribution to help correct the bug.

To run the tests, you can simply run the following test command/s.

$ npm run lint
$ npm run test
$ npm run coverage

Contributions

Feedback and contributions are more than welcome. Should you feel there is something you wish to contribute to this paginator, feel free to make a merge request. Ensure that whatever proposed change, has tests covering various cases for the change.