For Quick Async Data Operations
Edges takes a user-specified data chunk and performs asynchronous tasks on it, returning the end result. The point of this project is to create a data pipeline framework that can take full advantage of the async nature of Node.js.
Usage
Edges works by being assigned named async functions and then updating a schema-based JSON object with the ending of each subsequent Promise.
Here are the Docs so far.
Initializing your Edge
const Edges = Edge = //Your JSON Schema Here ;
Data-to-schema
If you want to create a schema out of an existing chunk of data, you can initialize your Edge with the static Edge.shape()
method.
Edge = Edgesshape // Your chunk of data here;
Adding a task
For each task, add a descriptor and an asynchronous function with one parameter for the data you'll be modifying. You can have any number of tasks.
Edge;
Running your tasks
When running tasks, be sure to have your first argument as an array of task names (['task1', 'task2', ...]
), and your second argument as the data to be modified through the async process.
The object that's fed in to Edge.runs()
will be checked for likeness to the 'shape' object defined in the Edge constructor.
Edge.runs()
will return a Promise containing the modified data.
Edge;