crema

syntactic sugar for your javascript functions

npm install crema
39 downloads in the last day
191 downloads in the last week
622 downloads in the last month

Example

var routes = crema('request -method=GET OR -method=POST authorize -> login');

Output:

[
  {
    "type": "request",
    "tags": {
      "method": "get"
    },
    "path": {
      "value": "login",
      "segments": [
        {
          "value": "login",
          "param": false
        }
      ]
    },
    "thru": {
      "path": {
        "value": "authorize",
        "segments": [
          {
            "value": "authorize",
            "param": false
          }
        ]
      }
    }
  }
]

Syntax

crema('type -tag=value route OR route2');

Custom Grammar

Use Cases

npm loves you