2.0.0 • Published 2 years ago

sushi-js v2.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago
      ___           ___           ___           ___
     /\  \         /\__\         /\  \         /\__\          ___
    /::\  \       /:/  /        /::\  \       /:/  /         /\  \
   /:/\ \  \     /:/  /        /:/\ \  \     /:/__/          \:\  \
  _\:\~\ \  \   /:/  /  ___   _\:\~\ \  \   /::\  \ ___      /::\__\
 /\ \:\ \ \__\ /:/__/  /\__\ /\ \:\ \ \__\ /:/\:\  /\__\  __/:/\/__/
 \:\ \:\ \/__/ \:\  \ /:/  / \:\ \:\ \/__/ \/__\:\/:/  / /\/:/  /
  \:\ \:\__\    \:\  /:/  /   \:\ \:\__\        \::/  /  \::/__/
   \:\/:/  /     \:\/:/  /     \:\/:/  /        /:/  /    \:\__\
    \::/  /       \::/  /       \::/  /        /:/  /      \/__/
     \/__/         \/__/         \/__/         \/__/

Sushi allows you to transform collections of JSON objects using a declarative syntax. We use it at CityHeroes to process the results of our RESTful APIs.

It's based on the concepts from AssemblyLine, but there are several improvements:

  • Extensible - you can add your custom filters, transformations and aggregations
  • Minimal - only the basic processes are part of the core
  • Independent - dependencies like underscore or moment are no longer required (at least for the core library)
  • More powerful - new features and capabilities like variables, the core helper, enhanced path notation

Basics

Glosary

  • Collection: Array of objects. This is the data set that Sushi processes.
  • Item: An object, part of the array.
  • Key: The object property that references a value within the object.
  • Value: A value that can of any type
  • Type: Object, Array, String, Number, Boolean, Null, Undefined

Overview

Sushi receives a collection and outputs another collection after it applies a series of steps to it. The steps are in turn composed by operations, which can be:

Overturn

Filters keys of the items of a collection.

Filters

Filters items of a collection.

Pickers

Pickers filter keys of the items of a collection.

Mappers

Filters keys of the items of a collection.

Usage

Development

Console:

Start the server: npm start Start the watcher: npm run watch

ToDo:

  • Flat array recipe format.
  • Async operations using Promise.
  • Time operations.
  • Review concepts within the library.
2.0.0

2 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.20

5 years ago

1.2.19

5 years ago

1.2.18

5 years ago

1.2.17

5 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.0.0

7 years ago