WTF JSPro is!
JSPro is nothing but JavaScript Prototypes! The publisher is too lazy to write full name that's why it's just JSPro. Whatever, it's a library of hundreds of awesome JavaScript Prototypes (you may know it as dot function) for lazy programmers. Just install the package with a little effort and leave the blames for the publisher.
Sigma rule 512
Life is not a pressure cooker, don't let the pressure get into it.
Not clear yet?
Currently you are able to use some limited prototypes. For rest of the small programs, you need to re-invent the wheel.
For example
To upper case string, you use
const name = "John"
console.log(name.toUpperCase())
// JOHN
or to lower case string
const name = "JOHN"
console.log(name.toLowerCase())
// john
But JavaScript doesn't have any built-in prototypes or functions to capitalize string. So to capitaize string you needed to write a user defined function like this
const capitalizeString = (str) => str[0].toUpperCase() + str.slice(1)
const name = "john"
console.log(capitalizeString(name));
// John
But using JSPro you will be able to code in JavaScript like a pro.
To capitalize string
const name = "john"
console.log(name.toCapitalCase())
// John
Isn't amazing?
JSPro has hundreds of awesome prototypes like this. You don't need to reinvent the wheel again.
Table of contents
Install
Simply install from you terminal
npm i jspro
Usage
You can use JSPro as Node module as well as ES6/ESNext module.
Node
require("jspro")
ESNext
import "jspro"
Prototypes
String
Capital Case
const name = 'john'
name.toCapitalCase()
// John
Reverse
const name = 'John'
name.reverse()
// nhoJ
Camel Case
const name = 'John Doe'
name.toCamelCase()
// johnDoe
Slugify
const name = 'Hello World'
name.slugify()
// hello-world
Customization
Yes, you can load only the prototypes you need.
require("jspro/string") // string only
require("jspro/number") // number only
require("jspro/object") // object only
require("jspro/array") // array only
By default, all four types of prototypes will be loaded.
Contribution
Publisher Jafran Hasan
Planning to contribute?
Seems like you are not too lazy!
Thanks for your interested. You can pull the repo from git. But you are requested to open a ticket before pushing for discussing on what you are planning to add.