@rdfc/js-runner 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/__tests__/echoProcessor.test.ts +11 -12
- package/bun.lock +820 -0
- package/lib/logger.d.ts +1 -0
- package/lib/logger.js +19 -9
- package/lib/reader.js +1 -1
- package/lib/runner.js +1 -1
- package/lib/testUtils/duplex.js +1 -1
- package/lib/testUtils/index.d.ts +9 -9
- package/lib/testUtils/index.js +9 -9
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -14
- package/src/logger.ts +15 -7
- package/src/reader.ts +8 -8
- package/src/runner.ts +3 -1
- package/src/testUtils/duplex.ts +1 -4
- package/src/testUtils/index.ts +25 -21
- package/.idea/LNKD.tech Editor.xml +0 -194
- package/.idea/codeStyles/Project.xml +0 -52
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/copilot.data.migration.agent.xml +0 -6
- package/.idea/copilot.data.migration.ask.xml +0 -6
- package/.idea/copilot.data.migration.ask2agent.xml +0 -6
- package/.idea/copilot.data.migration.edit.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/js-runner.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/dist/args.d.ts +0 -4
- package/dist/args.js +0 -58
- package/dist/connectors/file.d.ts +0 -15
- package/dist/connectors/file.js +0 -89
- package/dist/connectors/http.d.ts +0 -14
- package/dist/connectors/http.js +0 -82
- package/dist/connectors/kafka.d.ts +0 -48
- package/dist/connectors/kafka.js +0 -68
- package/dist/connectors/ws.d.ts +0 -10
- package/dist/connectors/ws.js +0 -72
- package/dist/connectors.d.ts +0 -73
- package/dist/connectors.js +0 -168
- package/dist/index.cjs +0 -732
- package/dist/index.d.ts +0 -42
- package/dist/index.js +0 -83
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/util.d.ts +0 -71
- package/dist/util.js +0 -92
- package/jest.config.js +0 -2
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# JavaScript runner for RDF-Connect
|
|
2
2
|
|
|
3
|
+
[](https://github.com/rdf-connect/js-runner/actions/workflows/build-test.yml) [](https://npmjs.com/package/@rdfc/js-runner)
|
|
4
|
+
|
|
5
|
+
This package provides a JavaScript runner implementation for RDF-Connect, which allows you to run JavaScript/TypeScript processors in your [RDF-Connect](https://github.com/rdf-connect/rdf-connect) pipeline.
|
|
6
|
+
|
|
3
7
|
## Usage
|
|
4
8
|
|
|
5
9
|
To use the JavaScript (Node or Bun) runner for RDF-Connect, you need to have a pipeline configuration that includes JavaScript/TypeScript processors.
|
|
@@ -70,12 +70,11 @@ describe('EchoProcessor', () => {
|
|
|
70
70
|
|
|
71
71
|
const msgs: string[] = []
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
;(async () => {
|
|
74
|
+
for await (const m of outputReader.strings()) {
|
|
75
|
+
msgs.push(m)
|
|
76
|
+
}
|
|
77
|
+
})()
|
|
79
78
|
|
|
80
79
|
await inputWriter.string('Hello')
|
|
81
80
|
expect(msgs).toEqual(['Hello'])
|
|
@@ -107,13 +106,13 @@ describe('EchoProcessor', () => {
|
|
|
107
106
|
|
|
108
107
|
const msgs: string[] = []
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
;(async () => {
|
|
110
|
+
for await (const m of outputReader.strings()) {
|
|
111
|
+
msgs.push(m)
|
|
112
|
+
}
|
|
113
|
+
})()
|
|
115
114
|
|
|
116
|
-
const gen = async function*() {
|
|
115
|
+
const gen = async function* () {
|
|
117
116
|
yield encoder.encode('Hello')
|
|
118
117
|
yield encoder.encode('World')
|
|
119
118
|
}
|