npm.io
1.0.0 • Published 4 months ago

@sempervirens/tools

Licence
MIT
Version
1.0.0
Deps
6
Size
23 kB
Vulns
0
Weekly
0

Sempervirens Tools

A set of tools for various purposes

Tests badge Version badge

Installation

npm i @sempervirens/tools;

Tools

Server Tools
startServer

Starts a Node Express server while keeping a set of sockets in order to stop the server later. (Mainly for use in tests.)

stopServer

Stops a server by ID started with startServer. (Mainly for use in tests.)

stopAllServers

Stops all servers started with startServer. (Mainly for use in tests.)

timestamp

Uses Moment.js to return a default format [MM-DD-YY hh:mm:ssa] and formattable string.

duration

Calculates a duration between a start and end parameter, both of which may be a moment or Date object. If not given, end is the current moment.

Keywords