Socket
Socket
Sign inDemoInstall

bees

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bees - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

28

lib/bees.js
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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc