crema

syntactic sugar for your javascript functions

12 个版本
安装
npm install crema
yarn add crema
pnpm add crema
bun add crema
README

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

版本列表
0.1.5 2012-11-22
0.1.4 2012-10-26
0.1.3 2012-06-12
0.1.2 2012-06-10
0.1.1 2012-03-05
0.1.0 2012-03-01
0.0.6 2012-02-17
0.0.5 2012-01-23
0.0.4 2012-01-19
0.0.3 2011-12-29
0.0.2 2011-12-27
0.0.1 2011-12-22