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.
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?');
node-extended › Globals › "node-extended"
▸ execute(command
: string): Promise‹string›
Defined in node-extended.ts:16
Execute a command
Parameters:
Name | Type | Description |
---|---|---|
command |
string |
Returns: Promise‹string›
▸ executeSync(command
: string): string
Defined in node-extended.ts:32
Execute a command syncronously
Parameters:
Name | Type | Description |
---|---|---|
command |
string |
Returns: string
▸ 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
: string): Promise‹string›
Defined in node-extended.ts:42
Read input from the user
Parameters:
Name | Type | Description |
---|---|---|
input |
string |
Returns: Promise‹string›
▸ 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
Defined in node-extended.ts:89
Defined in node-extended.ts:85
• execute: execute
Defined in node-extended.ts:85
• executeSync: executeSync
Defined in node-extended.ts:85
• fetch: fetch
Defined in node-extended.ts:85
• input: input
Defined in node-extended.ts:85
• isAnswerYes: isAnswerYes
Defined in node-extended.ts:85