arkin
Just ideas that popped into my head.
Last updated a year ago by arkinsolomon .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install arkin 
SYNC missed versions from official npm registry.

Arkin

Just ideas that popped into my head.

npm

NPM
GitHub

Features

Installation

To install, open your command line and navigate to your project folder. Then run:

npm install arkin

At the top of your program add:

const arkin = require('arkin');

Reference

Sleep

Information

Pauses the program for a short time.

Parameters

  • milliseconds: The amount of time in milliseconds to wait.

Usage

arkin.sleep(1000);

Pauses for 1000 milliseconds or 1 second.

End

Information

Ends the program with exit code 0.

Parameters

None

Usage

arkin.end()

Ends the program with exit code 0.

Error

Information

Ends the program with exit code 1 and logs the error.

Parameters

  • ERR: The error that happened.

Usage

var err = "Uh Oh";
arkin.error(err);

Outputs in the console:

There was an error:
Uh Oh

Ends the program with exit code 1.

Clear

Information

Clears the console.

Parameters

None

Usage

arkin.clear();

Clears the console.

List

Information

Takes an array and makes a list from it.

Parameters

  • list: An array containing the messages to be displayed.
  • config: [Optional] A JSON object which determines the starting number and marker.
    • startingNumber: [Optional] An integer which determines the first number of the list. Default: '1'.
    • marker: [Optional] A string which decides what separates the number and the message. Default: '.'.

Usage

const list = ["Yo", "hi", "hello"]

const config = {
  startingNumber: 1,
  marker: ')'
};

arkin.list(list, config);

Outputs in the console:

1) Yo
2) hi
3) hello

GetDate

Information

Gets the current date in any format.

Parameters

  • config: [Optional] A JSON object which determines the information and the way it is returned.
    • format: [Optional] Determines all of the formatting for the date.
      • order: [Optional] A string which specifies the order of the day, month, and year. Separated by hyphens. Default 'month-day-year'.
      • extraZero: [Optional] A boolean which while true, adds an extra zero to the beginning of both the day and month if it is less then ten. Default: 'true'.
      • year: [Optional] A string which determines the length of the year by the amount of 'y's in it. Removes numbers from the left. Default: 'yyyy'.
      • separator: [Optional] A string which determines the separator between the day, month, and year. Default: '/'.

Usage

Example date is February 23rd, 2064

  const config = {
    format: {
      order: 'year-month-day',
      extraZero: false,
      year: 'yyy',
      separator: ','
    }
  };

  var date = arkin.getDate(config);
  console.log(date);

Outputs in the console:

064,2,23

ToBoolean

Information

Returns a boolean value from a string or returns a float or returns a number

Parameters

  • boolIn: A string which contains the value to be returned
  • toInteger: [Optional] A boolean value which specifies weather or not to return a float

Usage

console.log(typeof arkin.toBool('true'), false);

Outputs in the console:

boolean

Current Tags

  • 1.3.1                                ...           latest (a year ago)

24 Versions

  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1 [deprecated]           ...           a year ago
  • 1.1.0 [deprecated]           ...           a year ago
  • 1.0.16 [deprecated]           ...           a year ago
  • 1.0.15 [deprecated]           ...           a year ago
  • 1.0.14 [deprecated]           ...           a year ago
  • 1.0.13 [deprecated]           ...           a year ago
  • 1.0.12 [deprecated]           ...           a year ago
  • 1.0.11 [deprecated]           ...           a year ago
  • 1.0.9 [deprecated]           ...           a year ago
  • 1.0.8 [deprecated]           ...           a year ago
  • 1.0.7 [deprecated]           ...           a year ago
  • 1.0.6 [deprecated]           ...           a year ago
  • 1.0.5 [deprecated]           ...           a year ago
  • 1.0.4 [deprecated]           ...           a year ago
  • 1.0.3 [deprecated]           ...           a year ago
  • 1.0.2 [deprecated]           ...           a year ago
  • 1.0.1 [deprecated]           ...           a year ago
  • 1.0.0 [deprecated]           ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |