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

@costantino03/javascript-starter-library

v1.0.6

Published

a starter library for javascript

Downloads

15

Readme

requiring the library

const js_starter = require("@costantino03/javascript-starter-library")

what does jsonparse do?

it parses a json object from a stringed json object into a json object

var object = '{"name":"Test","City":"New York"}'
var result = js_starter.jsonparse(object)
//result :
{"name":"Test","City"."New York"}

what does jsonreadable do?

it takes an stringed/not stringed json object and it puts in a readable format

var object = {"name":"Test","City":"New York"}
var result = js_starter.jsonreadable(object,spaces)
//result:
{
   "name": "Test",
   "City": "New York"
}
/*
the spaces argument is optional and the default value is 3
and you can pass even pass the stringed version of a json object and 
it will parse it and make it readable
*/

what does char_replacement_m do?

it takes a string and replaces all occurrences of a specific character

var string = "Hello-World"

var result = js_starter.char_replacement_m(string,"-"," ")

console.log("Before: "+string)

console.log("        ")

console.log("After: "+result)

/*
Terminal output:

Hello-World

Hello World
*/

what does getdsrole do?

first thing this function runs with discord.js 12.2.0

you pass the current discord.js instance(after the login)

returns the id of the specified role name

var role_name = "Admin"

var role_id = js_starter.getdsrole(discord-js_instance,role_name)

what does number_gen1 do?

it takes a a maximum value and it goes from 1 to the specified number

var result = js_starter.number_gen1(5)

console.log(result)

what does number_gen2 do?

it takes a a maximum and minium value and it goes from minium specified number to the maximum specified number

var result = js_starter.number_gen2(5,10)

console.log(result)

what does n_formatter do?

it takes a number and add commas to the number

var formatted = js_starter.n_format(1500)

console.log(formatted)

/*
terminal output:
1,500
*/

what does calc_percent do?

it takes 2 values, a current and a target and it calculates the percentage you are at

var percentage = js_starter.calc_percent(50,100)

console.log(percentage)
/*
terminal output:
50
*/

what does calc_percent_left do?

it takes 2 values, a current and a target and it calculates the percentage remaining to reach the target

var percentage = js_starter.calc_percent_left(50,150)

console.log(percentage)
/*
terminal output:
66.66
*/