Include service in loader. Closes #4
This commit is contained in:
parent
9859daee9b
commit
f2f3220229
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env -S node -r @syndicate-lang/loader
|
||||||
|
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
/// SPDX-FileCopyrightText: Copyright © 2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
|
|
||||||
|
const { stringify } = require('@syndicate-lang/core');
|
||||||
|
const { service } = require('@syndicate-lang/service');
|
||||||
|
|
||||||
|
service(args => {
|
||||||
|
console.log('+', stringify(args));
|
||||||
|
on stop { console.log('-', stringify(args)); }
|
||||||
|
});
|
|
@ -0,0 +1,9 @@
|
||||||
|
<require-service <daemon example>>
|
||||||
|
<daemon example {
|
||||||
|
argv: "./example.js"
|
||||||
|
protocol: application/syndicate
|
||||||
|
}>
|
||||||
|
? <service-object <daemon example> ?cap> [
|
||||||
|
$cap += =here-is-your-configuration!
|
||||||
|
$cap += =here-is-another-configuration!
|
||||||
|
]
|
|
@ -23,6 +23,7 @@
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/compiler": "^0.17.0",
|
"@syndicate-lang/compiler": "^0.17.0",
|
||||||
"@syndicate-lang/core": "^0.22.0"
|
"@syndicate-lang/core": "^0.22.0",
|
||||||
|
"@syndicate-lang/service": "^0.23.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
"url": "https://git.syndicate-lang.org/syndicate-lang/syndicate-js"
|
"url": "https://git.syndicate-lang.org/syndicate-lang/syndicate-js"
|
||||||
},
|
},
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "lib/index.js",
|
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"declarationDir": "./lib",
|
"declarationDir": "./lib",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"module": "es6",
|
"module": "commonjs",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
|
Loading…
Reference in New Issue