2.0.5 • Published 4 years ago

@robbie-cook/node-helper v2.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

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-helperGlobals"node-helper"

Module: "node-helper"

Index

Functions

Functions

execute

execute(command: string): Promise‹string›

Defined in node-helper.ts:16

Execute a command

Parameters:

NameTypeDescription
commandstring

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:

NameTypeDescription
endpointstring-
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:

NameTypeDescription
endpointstring-
bearerToken?undefined | string

Returns: Promise‹ArrayBuffer›


input

input(input: string): Promise‹string›

Defined in node-helper.ts:33

Read input from the user

Parameters:

NameType
inputstring

Returns: Promise‹string›


isAnswerYes

isAnswerYes(input: string): boolean | null

Defined in node-helper.ts:52

Whether the user accepted the input

Parameters:

NameTypeDescription
inputstring

Returns: boolean | null