crema

syntactic sugar for your javascript functions

npm install crema
2 downloads in the last day
147 downloads in the last week
565 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