0.7.0 • Published 2 years ago

@hugoalh/more-method v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

More Method (NodeJS)

MoreMethod.NodeJS GitHub Contributors GitHub Issues GitHub Pull Requests GitHub Discussions GitHub Stars GitHub Forks GitHub Languages CodeFactor Grade LGTM Alerts LGTM Grade License

ReleaseLatest (GitHub Latest Release Date)Pre (GitHub Latest Pre-Release Date)
GitHub GitHub Total DownloadsGitHub Latest Release VersionGitHub Latest Pre-Release Version
NPM NPM Total DownloadsNPM Latest Release VersionNPM Latest Pre-Release Version

📝 Description

A NodeJS module to provide more method.

📚 Documentation

For the official documentation, please visit GitHub Repository Wiki.

Getting Started (Excerpt)

Install

NodeJS (>= v14.15.0) + NPM (>= v6.14.8):

npm install @hugoalh/more-method

Use In CommonJS

const moreMethod = require("@hugoalh/more-method");

Use In ModuleJS

import * as moreMethod from "@hugoalh/more-method";

API (Excerpt)

Class

  • Replaceholder
    • @constructor(list, option?)
    • replace(item)

Function

  • changeCase(item, option?)
  • concatenate(...items)
  • depth(item)
  • divide(item, piece, option?)
  • ensureEndWith(item, endWith)
  • ensureStartWith(item, startWith)
  • escapeRegularExpressionSpecialCharacters(item)
  • flattenArray(item, option?)
  • flattenJSON(item, option?)
  • length(item, option?)
  • mathematics.combination(n, k)
  • mathematics.cumulativeCombination(n)
  • mathematics.cumulativePermutation(n)
  • mathematics.factorial(n)
  • mathematics.greatestCommonDivisor(group)
  • mathematics.leastCommonMultiple(group)
  • mathematics.maximum(group)
  • mathematics.mean(group)
  • mathematics.median(group)
  • mathematics.minimum(group)
  • mathematics.permutation(n, k)
  • mathematics.ratio(group)
  • nestify(item)
  • randomIndex(item)
  • removeANSIEscapeCodes(item)
  • removeDuplicate(item)
  • replaceholder(list, item, option?)
  • reverseIndex(item)
  • stringOverflow(item, maximumLength, option?)
  • stringParse(item, fuzziness?)

Function (Asynchronous)

  • waitTime(timeout, ...passThrough?)

Example (Excerpt)

let array1 = ["one", "two", "three"];
let array2 = ["one", "two", "three"];
console.log(Array.reverse(array1));
// ["three", "two", "one"]

console.log(array1);
// ["three", "two", "one"]

console.log(moreMethod.reverseIndex(array2));
// ["three", "two", "one"]

console.log(array2);
// ["one", "two", "three"]

let array3 = moreMethod.concatenate(array1, array2);
console.log(array3);
// ["three", "two", "one", "one", "two", "three"]

console.log(moreMethod.removeDuplicate(array3));
// ["three", "two", "one"]
0.7.0

2 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago