https://github.com/pinax-network/substreams-core
Substreams ESM core utility library
https://github.com/pinax-network/substreams-core
graph streamingfast substreams thegraph
Last synced: about 1 month ago
JSON representation
Substreams ESM core utility library
- Host: GitHub
- URL: https://github.com/pinax-network/substreams-core
- Owner: pinax-network
- License: mit
- Created: 2023-05-16T18:56:23.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-16T21:33:25.000Z (about 3 years ago)
- Last Synced: 2025-01-13T09:46:46.768Z (over 1 year ago)
- Topics: graph, streamingfast, substreams, thegraph
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@substreams/core
- Size: 515 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `@substreams/core`
> Substreams ESM core utility library
This is a work in progress. Your mileage may vary.
## Install
```sh
npm install @substreams/core
```
**⚠️Warning:** This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules). If your project uses CommonJS, you'll have to [convert to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) or use the [dynamic `import()`](https://v8.dev/features/dynamic-import) function. Please don't open issues for questions regarding CommonJS / ESM.
## Usage
```js
import { createSubstream } from "@substreams/core";
export async function fetchSubstream(url: string) {
const response = await fetch(url);
const blob = await response.blob();
const array = await blob.arrayBuffer();
return createSubstream(array);
}
```
## Authors
- [@fubhy](https://github.com/fubhy) (fubhy.eth, [Twitter](https://twitter.com/thefubhy))
- [@DenisCarriere](https://github.com/DenisCarriere) ([Twitter](https://twitter.com/DenisCarriere))
## License
[MIT](/LICENSE) License