Comparing version 0.0.1 to 0.0.2
var bees = module.exports = function(file) { | ||
var matches = file.match(/\/\*{1,2}(.|\n)+?\*\//g); | ||
var json = []; | ||
var matches = file.match(/\/\*{1,2}(.|\n)+?\*\//g), | ||
json = []; | ||
matches.map(function(m) { | ||
var sub = {}; | ||
m = m.split('\n'); | ||
m.pop(); | ||
m.shift(); | ||
var sub = {}; | ||
m.map(function(i) { | ||
i = i.replace(/\*/g, '').trim(); | ||
if(i === '') return; | ||
if(!i.length) return; | ||
if(~i.indexOf('@')) { | ||
sub.params = sub.params || {}; | ||
var option = i.match(/@(\w+)\s([\W\w]+)?/); | ||
switch(option[1]) { | ||
var cmd = i.match(/@(\w+)\s([\W\w]+)?/); | ||
cmd.shift(); | ||
switch(cmd[0]) { | ||
case 'param': | ||
var inside = option[2].match(/(\w+)\s([\W\w]+)?/); | ||
sub.params[inside[1]] = inside[2]; | ||
var datas = cmd[1].match(/(\w+)\s([\W\w]+)?/) | ||
datas.shift(); | ||
sub.params = sub.params || {}; | ||
sub.params[datas[0]] = datas[1]; | ||
break; | ||
case 'return': | ||
sub.return = option[2]; | ||
sub.return = cmd[1]; | ||
break; | ||
@@ -28,0 +32,0 @@ } |
{ | ||
"name": "bees", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "yawnt <yawn.localhost@gmail.com>", | ||
"description": "HTTP API Generator", | ||
"devDependencies": { | ||
@@ -12,3 +14,7 @@ "vows": ">= 0.0.0" | ||
"bees" : "./bin/bees" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/yawnt/bees.git" | ||
} | ||
} |
@@ -7,2 +7,8 @@ bees (in Italian ```API``` means ```bees```) | ||
## Install | ||
``` | ||
$ npm install bees | ||
``` | ||
## Example: | ||
@@ -44,3 +50,2 @@ | ||
"path":"/", | ||
"params":{}, | ||
"return":"Main page" | ||
@@ -47,0 +52,0 @@ }, |
@@ -16,3 +16,3 @@ var vows = require('vows'), | ||
json, | ||
'[{"method":"GET","path":"/","params":{},"return":"Main page"},{"method":"GET","path":"/:id","params":{"id":"id of the user"},"return":"user infos"}]' | ||
'[{"method":"GET","path":"/","return":"Main page"},{"method":"GET","path":"/:id","params":{"id":"id of the user"},"return":"user infos"}]' | ||
); | ||
@@ -19,0 +19,0 @@ } |
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3376
71
2
74
1