jsshort
Version:
It will make your codes much short and easiar
115 lines (94 loc) • 1.67 kB
Markdown
npm i jsshort
you can use like this
```js
require("jsshort")
let integerValue = int("3") // here int is short function
console.log(integerValue)
```
like this there are many functions
input;
print
int;
str;
float;
bool;
array;
Input output functions:
```js
require("jsshort")
async function sum {
let a = await input("Enter first number: ")
let b = await input("Enter 2nd number: ")
print("Sum of both numbers:", end=" ");
print(int(a) + int(b))
}
sum();
```
```js
require("jsshort")
async function sum {
let a = await input("Enter first number: ")
let b = await input("Enter 2nd number: ")
// it will store Output of this function in output.txt file
print("Sum of both numbers:", int(a) + int(b), {file: "./path/output.txt"});
}
sum();
```
Input output functions in typescript
```ts
import f from "jsshort";
async function sum {
let a:string = await f.input("Enter first number: ")
let b:string = await f.input("Enter 2nd number: ")
f.print("Sum of both numbers:", {end: " "});
f.print(f.int(a) + f.int(b))
}
sum();
```
String functions
Uses example
```js
require("jsshort")
let stringg = "This is my string"
let length =string.len(); // uses of len function
console.log(length)
```
more functions name
len
str
add
sb
ind
lstInd
inString
start
end
upr
lwr
trS
trE
rpc
rpcA
at
chCdAt
locCmp
There are many array functions:
Uses example
```js
require("jsshort")
let arr1 = [1, 2, 3]
let arr2 = [4, 5]
let newArray = arr1.add(arr2) // uses of add function
console.log(newArray)
```
more functions:
add
ind
lstInd
inArray
forE
rdc
rdcR
fndInd
By https://Telegram.me/PanditSiddharth