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

@redeakaa/tooljs

v1.0.1

Published

A collection of useful JavaScript functions and methods for front-end development

Downloads

15

Readme

NPM Downloads NPM License | Like us a lot? Help others know why you like us! Review this package on pkgreview.dev | ➡ | Review us on pkgreview.dev | | ----------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------------------------------------------------------------------- |

ToolJS 🛠⚙

This is an open-source collection of functions, methods and routine javascript operations which every front-end developer might have a use for at some point in their project.

It bascially simplifies your work flow by shorthanding some of the long boring codes you write everytime which may consist of so many functions, variables, methods and so on, into a single function. From DOM manipulation, to mathematical calculations to string manipulations and so on all in one library(Pretty useful uh!😎).

Why write or copy the same code over and over again when you could just have it all in one library for easy access (Well step right up ToolJS 👏).

Table of Content 📜

Documentation

See the full documentation and api here ToolJS Documentation and API

Installation:

In Node.js

npm install @redeakaa/tooljs

For Browser

<script src="https://unpkg.com/@redeakaa/[email protected]/dist/umd/tooljs.min.js"></script>

For Browser(As a module)

<script type="module" src="https://unpkg.com/@redeakaa/[email protected]/dist/esm/tooljs.esm.js"></script>

Usage

Usage In Node.js

To include the libraries default export

const ToolJS = require("@redeakaa/tooljs).default;

Then export a module or an array of modules to a variable and use as needed

var $ = ToolJS.export(["Str", "Calc", "Utils"]);

var total = $.add(10, 50, 40);
console.log(total);
// => 100

var toCamelCase = $.camelCase("Hello World from ToolJS");
console.log(toCamelCase);
// => "helloWorldFromToolJS"

var type = $.typeOf(400);
console.log(type);
// => "number"

Or you can include any of the libraries named exports and call any of its registered methods.

const { DOM, Obj, Str, Num, Calc, Utils } = require("@redeakaa/tooljs");

var capitalized = DOM.capitalize("hello world from toolJS");
console.log(capitalized);
// => "Hello World From ToolJS"

var obj = Obj.push({ name: "John Doe", age: 25 }, { gender: "Male" });
console.log(obj);
// => { name: "John Doe", age: 25, gender: "Male" }

Usage In Browser

If you included the tooljs.min.js file or the tooljs.umd.js, then the ToolJS namespace is automatically exposed to the window object.

// export all methods in all registered module
var _ = ToolJS.export();

// increment 10 by 5.
var val = _.increment(10, 5);
console.log(val);
// => 15

var odd = _.isOdd(27);
console.log(odd);
// => true"

// gets the element whose id = "#myElement"
var el = _.getEl("#myElement");

For ES6 Module's Import Style

var url = "https://unpkg.com/@redeakaa/[email protected]/dist/esm/tooljs.esm.js";

import { Utils, Obj } from url;

// sets a cookie which expires in days
Utils.setCookie("username", "John Doe", 14, "/");

// gets the cookie named "username"
var user = Utils.getCookie("username",);
console.log(user);
// => "John Doe"

var myObj = Obj.toObj(["John Doe", "Male"]);
console.log(myObj);
// => { 0: "John Doe", 1: "Male" }

Check out the libraries official documentation page to see a list of all available methods for each module and how to create a module/plugin of your own.

Contributions

Please feel free to make contributions to this project at any point in time. Find any bug, open an issue and we'll fix it together.

Credits

  • Made with 💝 by Okoro Redemption.