Skip to content

jsmney/2020-04-17-personal-npm-package

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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... )

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%