npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

blue-terminal-api-lib

v2.0.2

Published

library for terminal api

Readme

What is this?

This library is an abstraction for terminal-api usage.

It exposes certain functions to interact with the api

Install:

npm install --save blue-terminal-api-lib

Usage:

Code

const terminalInstanceCreator = require("blue-terminal-api-lib");
const terminalInstance = terminalInstanceCreator({...options});

const foldersFunctions = terminalInstance.folders;
const downloadsFunctions = terminalInstance.downloads;
const uploadsFunctions = terminalInstance.uploads;

// now you can use all functions. 

Options

  • terminalUrl: (critical!) url to terminal api - example: http://terminal-api/api/v1 - default = http://localhost:8100

  • apiKey: (critical!) full apiKey to authenticate terminal api with as a specific service - default: 'key'

  • useBearer: set to false to not use 'Bearer' keyword in Authorization header of api request - default: true

  • foldersEndpoint: the url endpoint for accessing the "folders" resource - default: /static/folders

  • uploadEndpoint: the url endpoint for accessing the "upload" resource - default: /static/upload

  • downloadEndpoint: the url endpoint for accessing the "download" resource - default: /static/download

  • fileIdAccessString: the (string) property name of the "id" attribute in the returned File object ( when accessing files ) - default: id

Functions:

  • All functions return a promise that resolves as an object such as the following:
{
    status: Number, 
    message: String, 
    data: Object
}
  • example:
const getDataFromFunction = async () => {
    const {status, message, data} = await terminalInstance.folderOrUploadOrDownload.someFunction();
    return data; 
}

Folder Functions:

  • createFolder:
/**
* recieve folder metadata and creates new folder in terminal-api
* @param {String} title                 - folder title
* @param {String} sourceNetwork         - source network
* @param {String} destinationNetwork    - destination network
* @param {[String]} to                  - array of user id's to send file to
* @param {String} from                  - file senders user id
* @returns {Object}                     - folder object from terminal-api
*/

function createFolder(title, sourceNetwork, destinationNetwork, to, from)
  • getAll:
/**
 * gets all folders from terminal api
 * @returns {Object}    - folder objects from terminal
 */
function getAll()
  • getAllByType:
/**
* gets all folders with given "type"
* @param {String} type - folder type
* @returns {[Object]}  - terminal folder objects
*/
function getAllByType(type)
  • getAllIncomingByServiceType:
/**
 * gets all folders with given "service" attribute
 * @param {String} type - folder service
 * @returns {[Object]}  - terminal folder objects
 */
function getAllIncomingByServiceType(service)
  • getById:
/**
 * gets a single folder with given id
 * @param {String} folderId     - given folder id
 * @returns {Object}            - folder object from terminal
 */
function getById(folderId)
  • getFiles:
/**
 * gets all files in folder by folder id
 * @param {String} folderId - folder id
 * @returns {[Object]}      - arrray of file objects from terminal
 */
function getFiles(folderId)
  • getFileFromFolder:
/**
 * returns specific file from folder based on folder and file ids
 * @param {String} folderId     - folder id
 * @param {String} fileId       - file id
 * @returns {Object}            - file object from terminal
 */
function getFileFromFolder(folderId, fileId);
  • sendFolder:
/**
 * marks a folder as available for sending to other side
 * @param {String} folderId 
 */
function sendFolder(folderId)
  • acknowlegeFolder:
/**
 * marks an "incoming" folder as viewed and handled ( acknowleges it )
 * @param {String} folderId 
 */
function acknowlegeFolder(folderId)

Download Functions:

  • downloadFolder:
/**
 * returns a base64 string representing the folder (by id) with all its files in .zip format
 * @param {String} folderId 
 */
function downloadFolder(folderId) 
  • downloadFileFromFolder:
/**
 * returns a base64 string representing the specific file in given file format
 * @param {String} folderId 
 * @param {String} fileId 
 */
function downloadFileFromFolder(folderId, fileId)
  • downloadFileFromFolderAsStream:
/**
 * returns a readable stream representing the specific file 
 * @param {String} folderId 
 * @param {String} fileId 
 */
function downloadFileFromFolderAsStream(folderId, fileId)

Upload Functions:

  • uploadFileToFolder:
/**
 * uploads a file to folder with given metadata
 * @param {String} folderId         - existing folder if
 * @param {String} fileName         - name to give to file
 * @param {String} content          - base64 string representing the file
 * @param {String} relativePath     - (optional) relative path to save in metadata
 */
function uploadFileToFolder(folderId, fileName, content, relativePath = '/tmp')