Introduction to Scramjet
Scramjet is a fast, simple, free and open source functional reactive stream programming framework written on top of node.js streams with multi-threadding support. The code is written by chaining functions that transform data easily with ES7 async/await syntax. It is built upon the logic behind three well known javascript array operations: map, filter and reduce. Scramjet transforms are so standard and natural that we're sure you can start writing your code straight away.
StringStream
.from(async function* () => {
let current_url = url;
while (current_url) {
const res = await fetch(url);
if (!res.ok) throw new Error("Aaaaargh!")
yield* res.body;
current_url = res.headers['x-next-page'];
}
})
.split(/\r?\n/)
.parse(str => str.split("\t"))
.map(
async ([name, ...items]) => insertToDB({name, items})
)
.reduce(
async (acc, {score}) => acc + await dedupe(inserted),
0
)
.then(() => console.log(`Import completed`))
.catch(e => console.error(`Import failed "${e.message}"`))
Start using Scramjet
Scramjet reference & docs
See the method and class documentation as well as meaninfull articles on using Scramjet in your project.
Read the * manualAdd Scramjet to your project using NPM
Install ScramjetSee source code and fork on github
See Scramjet's codeReport and browse current issues and known bugs on github issues
See issuesJoin the conversation on Scramjet's Slack
Discuss nowSee Scramjet build status and history.
Build now