@jsmney/minitools

2.3.1 • Public • Published

Jasmine's personal NPM JS Utility library

npm(scoped) install size license top language

Created in April 2020 in participation of a Mintbean Hackathon. github

Install

$ npm install @jsmney/minitools

Usage

const mini = require('@jsmney/minitools')

// adds one!
mini.addOne(3) // 4

// emulates behavior of the infamous [left-pad](https://www.npmjs.com/package/left-pad)

mini.leftPad('hello', 10) // '     hello'
mini.leftPad(100, 10, '0') // '0000000100'
mini.leftPad(100, 1, '0') // Error: cannot pad, argument is too long

// leftPad, but for all elements in an array
mini.leftPadAll(['hi', 'hello', 'greetings', 'yo'], 15)
// [
//   '             hi',
//   '          hello',
//   '      greetings',
//   '             yo'
// ]

// Happy Number checker!
mini.isHappy(19) // true
mini.isHappy(20) // false

Example execution on RunKit

Check it out on my RunKit playground

Requirements

  1. Create a personal npm library.
  2. Fill it with methods you would find useful in future projects.
  3. Publish it to npm (you may have to sign up for an npm account).
  4. Demonstrate that it can be required right from npm, by building a project using Runkit or Codepen

Resources

Additional Links

For future reference ( as I grow this... )

Readme

Keywords

Package Sidebar

Install

npm i @jsmney/minitools

Weekly Downloads

6

Version

2.3.1

License

MIT

Unpacked Size

5.88 kB

Total Files

4

Last publish

Collaborators

  • jsmney