1.0.2 ā€¢ Published 4 months ago

str-kit v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

str-kit

šŸ› ļø Some strings functions that can be usefull

const {
  /* All functions you need */
} = require("str-kit");

šŸ¤” Need to capitalize you string?

const { capizalize } = require("str-kit");

console.log(capitalize("strings are cool!")); // "Strings are cool!"

šŸ¤” Need to capitalize each word of a string?

const { capAll } = require("str-kit");

console.log(capAll("strings are cool!")); // "Strings Are Cool!"

šŸ¤” Need to reverse a string easily?

const { reverse } = require("str-kit");

console.log(reverse("strings are cool!")); // "!looc era sgnirts"

šŸ¤” Need to know how many "words" a string have?

const { words } = require("str-kit");

console.log(words("strings are cool!")); // 3

šŸ¤” Need to clean (remove useless space at the start & the end) a string?

const { clean } = require("str-kit");

console.log(clean("   strings are cool!    ")); // "strings are cool!"

šŸ¤” Need to randomize your string?

const { randomize } = require("str-kit");

console.log(randomize("strings are cool!")); // For example, "r oioressacgnlt !"

šŸ¤” Need to randomize the caps in a string?

const { randomCaps } = require("str-kit");

console.log(randomCaps("strings are cool!")); // For example, "STriNGS aRe cOol!"

šŸ¤” Need to truncate your string?

const { trunc } = require("str-kit");

console.log(trunc("strings are cool!", 6)); // "string..."

šŸ¤” Need to "numerize" a string?

const { numerize } = require("str-kit");

console.log(numerize("strings are cool!")); // "str1ngs 4r3 c00l!"

šŸ¤” Need to know how many times 'char' appears on a string?

const { occurence } = require("str-kit");

console.log(occurence("strings are cool!", "o")); // 2
console.log(occurence("strings are cool!", "str")); // 1
console.log(occurence("strings are cool!", "f")); // 0

šŸ¤” That's all for the moment, feel free to do a PR on the GitHub!

šŸ“Ž:

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

5 months ago