Arrakis Javascript client library
This library is built as an ES module and works in both browser and Node.js environments.
npm install arrakis-js
# or
yarn add arrakis-js
# or
pnpm add arrakis-js
For browser usage, you can load the library directly from a CDN:
<script type="module">
import * as arrakis from 'https://cdn.jsdelivr.net/npm/arrakis-js/dist/index.js';
</script>
Or as a traditional script (creates global arrakis
object):
<script src="https://cdn.jsdelivr.net/npm/arrakis-js/dist/arrakis.min.js"></script>
For Node.js projects, you can use dynamic imports:
const arrakis = await import('arrakis-js');
Note: The find()
function requires an EventSource polyfill in Node.js:
npm install eventsource
- Query live and historical timeseries data
- Describe channel metadata
- Search for channels matching a set of conditions
import * as arrakis from 'arrakis-js';
const channels = [
"H1:CAL-DELTAL_EXTERNAL_DQ",
"H1:LSC-POP_A_LF_OUT_DQ",
];
for await (const block of arrakis.stream(channels)) {
console.log(block);
}
import * as arrakis from 'arrakis-js';
const start = 1187000000;
const end = 1187001000;
const channels = [
"H1:CAL-DELTAL_EXTERNAL_DQ",
"H1:LSC-POP_A_LF_OUT_DQ",
];
for await (const block of arrakis.stream(channels, start, end)) {
console.log(block);
}
import * as arrakis from 'arrakis-js';
const channels = [
"H1:CAL-DELTAL_EXTERNAL_DQ",
"H1:LSC-POP_A_LF_OUT_DQ",
];
const metadata = await arrakis.describe(channels);
where metadata
is a dictionary mapping channel names to
[arrakis.channel.Channel][].
import * as arrakis from 'arrakis-js';
for await (const channel of arrakis.find("H1:LSC-*")) {
console.log(channel);
}
where channel
is a [arrakis.channel.Channel][].
import * as arrakis from 'arrakis-js';
const count = await arrakis.count("H1:LSC-*");