$ cnpm install crema
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
}
]
}
}
}
]
crema('type -tag=value route OR route2');
Copyright 2013 - present © cnpmjs.org | Home |