Skip to content

Robbie-Cook/node-extended

Repository files navigation

NodeExtended


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): Promise‹string›

Defined in node-extended.ts:16

Execute a command

Parameters:

Name Type Description
command string

Returns: Promise‹string›


executeSync

executeSync(command: string): string

Defined in node-extended.ts:32

Execute a command syncronously

Parameters:

Name Type Description
command string

Returns: string


fetch

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

Defined in node-extended.ts:72

Fetch anything. Uses node-fetch under the hood.

Parameters:

Name Type Description
endpoint string -
bearerToken? undefined | string

Returns: Promise‹Response›


input

input(input: string): Promise‹string›

Defined in node-extended.ts:42

Read input from the user

Parameters:

Name Type Description
input string

Returns: Promise‹string›


isAnswerYes

isAnswerYes(input: string): boolean | null

Defined in node-extended.ts:61

Whether the user accepted the input

Parameters:

Name Type Description
input string

Returns: boolean | null

Object literals

Const NodeExtended

NodeExtended: object

Defined in node-extended.ts:89


Const combined

combined: object

Defined in node-extended.ts:85

execute

execute: execute

Defined in node-extended.ts:85

executeSync

executeSync: executeSync

Defined in node-extended.ts:85

fetch

fetch: fetch

Defined in node-extended.ts:85

input

input: input

Defined in node-extended.ts:85

isAnswerYes

isAnswerYes: isAnswerYes

Defined in node-extended.ts:85

About

A set of common helper functions for node programs

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •