npm.io
4.10.2 • Published 9 years ago

static-engine-sort

Licence
MIT
Version
4.10.2
Deps
0
Vulns
0
Weekly
0

static-engine-sort

Dependency Status devDependency Status js-standard-style

This is a plugin for static-engine. Sorts the collection using the provided sort function.

var engine = require('static-engine')
var sort = require('static-engine-sort')
var pluginA = require('plugin-a')

engine([
  pluginA,
  sort(function (a, b) {
    if (a.property < b.property) {
      return -1
    }

    if (b.property < a.property) {
      return 1
    }

    return 0
  })
])

Keywords