Welcome to Node Helper! Contributions are always welcome, but please make an issue first.
Getting started
First, make sure you import the helper with
import NodeHelper from '@robbie-cook/node-helper'
or, equally,
const NodeHelper = require('@robbie-cook/node-helper');
API
@robbie-cook/node-helper › Globals › "node-helper"
Module: "node-helper"
Index
Functions
Functions
execute
▸ execute(command
: string): Promise‹string›
Defined in node-helper.ts:16
Execute a command
Parameters:
Name | Type | Description |
---|---|---|
command |
string |
Returns: Promise‹string›
fetch
▸ fetch(endpoint
: string, bearerToken?
: undefined | string): Promise‹Response›
Defined in node-helper.ts:83
Fetch anything. Uses node-fetch under the hood.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | - |
bearerToken? |
undefined | string |
Returns: Promise‹Response›
fetchFile
▸ fetchFile(endpoint
: string, bearerToken?
: undefined | string): Promise‹ArrayBuffer›
Defined in node-helper.ts:62
Fetch a file from an endpoint
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | - |
bearerToken? |
undefined | string |
Returns: Promise‹ArrayBuffer›
input
▸ input(input
: string): Promise‹string›
Defined in node-helper.ts:33
Read input from the user
Parameters:
Name | Type |
---|---|
input |
string |
Returns: Promise‹string›
isAnswerYes
▸ isAnswerYes(input
: string): boolean | null
Defined in node-helper.ts:52
Whether the user accepted the input
Parameters:
Name | Type | Description |
---|---|---|
input |
string |
Returns: boolean | null