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

string-dooku

v1.0.1

Published

A tiny npm package to perform basic string methods

Downloads

1

Readme

String-Dooku

A tiny npm package to perform basic string methods


// import the package 
const str = require("string-dooku")

// create a new instance of the function
const ins = new str()

// change string case to upper
console.log(ins.toUpperCase("hello world")) // output: -> HELLO WORLD

// reverse a string
console.log(ins.reverse("Hello World")) // output -> dlroW olleH

// check substring -- we need to pass two parameters so this function will check the first argument of the function same as the second one then it will return a boolean value
console.log(ins.checkSubstring("app" , "app")) // output -> true

// duplication count
console.log(app.duplicationCount("Hello World")); // output -> { H: 1, e: 1, l: 4, o: 2, ' ': 1, W: 1, r: 1, d: 1 }

// import the package 
const str = require("string-dooku")

// create a new instance of the function
const ins = new str()

// change case to UpperCase
console.log(ins.toUpperCase("Hello World")) // output -> HELLO WORLD

// change case to lowercase
console.log(ins.toLowerCase("Hello World")) // output -> hello world

// change the case to pascal case
console.log(ins.toPascalCase("Hello World")) // output -> HelloWorld

// change the case to snake case
console.log(ins.toSnakeCase("Hello World")) // output -> hello_world

// change the case to dot case
console.log(ins.toDotCase("Hello World")) // output -> hello.world

// change the case to space case
console.log(ins.toSpaceCase("Hello World")) // output -> H e l l o   W o r l d

// change the case to title case
console.log(ins.toTitleCase("hello world")) // output -> Hello World

// get the total length of the string
console.log(ins.length("Hello World")) // output -> 11

// check the if first argument is same as the second argument
console.log(ins.checkValue("Hello" , "Hello")) // output -> true

// duplication count of the each word in the string
console.log(app.duplicationCount("Hello World")); // output -> { H: 1, e: 1, l: 4, o: 2, ' ': 1, W: 1, r: 1, d: 1 }

// reverse a string
console.log(ins.reverse("Hello World")) // output -> dlroW olleH

// its is same as checkValue. both function check if the first argument is same as the second argument
console.log(ins.checkSubstring("app" , "app")) // output -> true

// check the longest string
console.log(ins.longestWord("Hello World")) // output -> Hello

// convert to string
console.log(typeof ins.toString([1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ])); // output -> string

// convert to string into a array
console.log(ins.toArray("Hello World")); // output -> [ 'Hello', 'World' ]

// to returns the character from the specified index.
console.log(ins.characterAt("Hello World" , 2); // output -> l

// this function determines whether a string ends with the characters of a specified string, returning true or false as appropriate.
console.log(ins.endsWith("Hello World" , "World")); // output -> true

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/string-dooku)
  3. Commit your changes (git commit -am 'First commit')
  4. Push to the branch (git push origin feature/string-dooku)
  5. Create a new Pull Request