1.1.0 • Published 3 years ago

node-extended v1.1.0

Weekly downloads
59
License
ISC
Repository
github
Last release
3 years ago

NodeExtended makes difficult node functions easier.

For example, to request input from the user:

const response = await NodeExtended.input('What is your age?');

Contributions are always welcome, but please make an issue first.

Getting started

First, make sure you import the helper with

import NodeExtended from 'node-extended'

or, equally,

const { NodeExtended } = require('node-extended');

Then, you can use methods like so:

const response = await NodeExtended.input('What is your age?');

API

node-extendedGlobals"node-extended"

Module: "node-extended"

Index

Functions

Object literals

Functions

execute

execute(command: string, dir?: undefined | string): Promise‹string›

Defined in node-extended.ts:17

Execute a command

Parameters:

NameTypeDescription
commandstring
dir?undefined | string-

Returns: Promise‹string›


executeSync

executeSync(command: string, dir?: undefined | string): string

Defined in node-extended.ts:33

Execute a command syncronously

Parameters:

NameTypeDescription
commandstring
dir?undefined | string-

Returns: string


fetch

fetch(endpoint: string, bearerToken?: undefined | string): Promise‹Response›

Defined in node-extended.ts:73

Fetch anything. Uses node-fetch under the hood.

Parameters:

NameTypeDescription
endpointstring-
bearerToken?undefined | string

Returns: Promise‹Response›


input

input(input: string): Promise‹string›

Defined in node-extended.ts:43

Read input from the user

Parameters:

NameTypeDescription
inputstring

Returns: Promise‹string›


isAnswerYes

isAnswerYes(input: string): boolean | null

Defined in node-extended.ts:62

Whether the user accepted the input

Parameters:

NameTypeDescription
inputstring

Returns: boolean | null

Object literals

Const NodeExtended

NodeExtended: object

Defined in node-extended.ts:97


Const combined

combined: object

Defined in node-extended.ts:86

execute

execute: execute

Defined in node-extended.ts:87

executeSync

executeSync: executeSync

Defined in node-extended.ts:91

fetch

fetch: fetch

Defined in node-extended.ts:90

getRandomInt

getRandomInt: getRandomInt = Random.getRandomInt

Defined in node-extended.ts:92

input

input: input

Defined in node-extended.ts:89

isAnswerYes

isAnswerYes: isAnswerYes

Defined in node-extended.ts:88

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.0

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago