saramjs v1.1.20
SaramJs
The node library to interact with Saram
. Both Typescript and Javascipt can be used.
This library exports three main classes.
- Saram
- SaramInit
- SaramAPI
The Saram
class is primary used to interact with the Saram
server, and send it various output from commands run, files read, or script variables. This class simplifies the use of the Saram
API.
The SaramInit
class is purely intended to set the .saram.conf
file which all modules of Saram
relies on.
The SaramAPI
class exposes the entire Saram
API to be used programmatically.
Installation
npm i saramjs --save
Usage
Before use
saramJs relies of obtaining the API key and username from a local config file. To set up this config file, use:
const {SaramInit} = require('saramjs')
SaramInit('yourApiKey').init()
This will create the local creds file for you. Optionally, pass base_url
or local
to true modify the base url that is set.
Javascript
// require Saram
const {Saram} = require('saramjs')
// Initialize a new Saram instance
const saram = new saramJs.Saram('someToken')
// Call any avaialble methods using
saram.methodName()
// Example: This will read the script itself and send to the server
saram.readScriptSelf().send()
Typescript
// Only difference between TS and JS is how it is imported
import { Saram } from 'saramjs'
Docs
Docs are available here To generate docs using Typedoc, use
npm run docs
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago