Skip to content

installers.lang.nodejs #

nodejs

To get started



import freeflowuniverse.herolib.installers.something.nodejs as nodejs_installer

heroscript:='
!!nodejs.configure name:'test'
    password: '1234'
    port: 7701

!!nodejs.start name:'test' reset:1 
'

nodejs_installer.play(heroscript=heroscript)!

//or we can call the default and do a start with reset
//mut installer:= nodejs_installer.get()!
//installer.start(reset:true)!

example heroscript

!!nodejs.configure
    homedir: '/home/user/nodejs'
    username: 'admin'
    password: 'secretpassword'
    title: 'Some Title'
    host: 'localhost'
    port: 8888

Constants #

const version = '9.15.2'

fn get #

fn get(args_ ArgsGet) !&NodeJS

fn heroscript_dumps #

fn heroscript_dumps(obj NodeJS) !string

fn heroscript_loads #

fn heroscript_loads(heroscript string) !NodeJS

fn play #

fn play(args_ PlayArgs) !

fn switch #

fn switch(name string)

switch instance to be used for nodejs

struct ArgsGet #

@[params]
struct ArgsGet {
pub mut:
	name string
}

///////FACTORY

struct DefaultConfigArgs #

@[params]
struct DefaultConfigArgs {
	instance string = 'default'
}

helpers

struct InstallArgs #

@[params]
struct InstallArgs {
pub mut:
	reset bool
}

struct NodeJS #

@[heap]
struct NodeJS {
pub mut:
	name string = 'default'
}

fn (NodeJS) destroy #

fn (mut self NodeJS) destroy() !

fn (NodeJS) install #

fn (mut self NodeJS) install(args InstallArgs) !

struct PlayArgs #

@[params]
struct PlayArgs {
pub mut:
	heroscript string // if filled in then plbook will be made out of it
	plbook     ?playbook.PlayBook
	reset      bool
}