Old version of Adamocomp.
Go to file
2021-03-21 04:48:50 -04:00
test init 2020-05-21 08:08:44 -04:00
.gitignore Maintenance. 2020-12-11 05:49:35 -05:00
broker.sh Updates to some URLs and other things. 2020-10-04 20:16:21 -04:00
completions.sh Updates to some URLs and other things. 2020-10-04 20:16:21 -04:00
data-tool.js init 2020-05-21 08:08:44 -04:00
data.json Moved a bunch more stuff to script references. 2021-03-21 04:48:50 -04:00
package-lock.json Maintenance. 2020-12-11 05:49:35 -05:00
package.json init 2020-05-21 08:08:44 -04:00
parser.js init 2020-05-21 08:08:44 -04:00
README.md Update README.md 2020-05-21 12:17:47 +00:00

Adamocomp

The adamocomp is an automaton worker that is able to fuzzy-parse mixed and unorganized data in order to perform local and remote operations across very flexible host clusterings. Its primary purpose is to handle complicated operations that must be done precisely the same way across multiple systems. But in reality it assists me in virtually all of my system operations tasks.

Adamocomp Data Parser

This library provides methods to interpret the adamocomp data file.

Example Usage

const Parser = require('adamocomp/parser.js');

var parser = new Parser();

parser.get.data('gitlab repo').then(function(data){
 // "data" contains all data for the gitlab deal
})

parser.get_formatted.data('gitlab repo').then(function(printable){
   // Standard output as stringified json.
   console.log(printable)
})

// parser.get_formatted.root('gitlab').then(function(str){
//   console.log(str)
// }
// Output below
node data_tool.js path "gitlab"
# ["gitlab"]

Constructor Options

  • new Parser({options})
property type description default
path string Path to data file ${program_root}/data.json

Methods

get.file()

Type: async

Params: none

Returns: an object literal of the data file.

parser.get.file().then(function(file){
   // 'file' is the entire data file
})

get.data(string)

Type: async

param type description
1 string search string

Returns: data tree underneath node corresponding to search string, if found, otherwise null.

parser.get.data(str).then(function(data){
   console.log(JSON.stringify(data));
})

get.root(string)

Type: async

param type description
1 string search string

Returns: array of keys (directories) leading to deal, if found, or an empty array.

parser.get.root(str).then(function(nodes){
   console.log(locations);
   // ['gitlab']
})

get.list()

Type: async

Params: none

Returns: array of all deployments in the environment.

parser.get.list().then(function(deployments){
   console.log(location);
   // ['gitlab', 'factorio/clusterio_host', 'factorio/factorio_host', etc.]
})

Running Tests

npm test