pathfinder-ui
Advanced tools
Comparing version 0.1.1111 to 0.1.1391
33
index.js
@@ -1,32 +0,1 @@ | ||
module.exports = require('./lib/pathfinder-ui.js'); | ||
// write all the logic in there ^ | ||
//Do not touch this file. | ||
//I mean it. | ||
//Seriously, don't put anything here. | ||
//I'm totally cereal. | ||
//If you are looking for code, you won't find it here. | ||
//But what you will find are a particular set of quotes. | ||
//Quotes acquired over a very long saturday afternoon. | ||
//Quotes that make me a warning for people like you. | ||
//If you leave this page now, that'll be the end of it. | ||
//I will not look for you, I will not pursue you. | ||
//But if you dont', I will look for you. | ||
//I will find you. | ||
//And I will pour glitter all over you. | ||
module.exports = require('./lib/pathfinder-ui.js'); |
var example = require('./example'); | ||
var pfroute = require('./pfroute'); | ||
// var Table = require('cli-table'); | ||
// var table = new Table({ head: ["Method", "SubRouter", "Path"] }); | ||
var table = []; | ||
module.exports = pathfinderUI; | ||
var expressApp = null; | ||
function pathfinderUI (app){ | ||
expressApp = null; | ||
var packageJsonPath = process.cwd() + '/package.json'; | ||
var packageJsonName = require(packageJsonPath).name; | ||
module.exports = startHere; | ||
pfroute.request.RESTroutes = { | ||
routes: generateRouteTree(app), | ||
appId: packageJsonName | ||
}; | ||
function startHere (app){ | ||
pfroute.request.routeTable = table; | ||
example(); | ||
} | ||
function generateRouteTree(app) { | ||
var topLevelRouteStack = app._router.stack; | ||
var routeObj = { | ||
url: packageJsonName, | ||
children: retrieveRoutes(topLevelRouteStack) | ||
}; | ||
return routeObj; | ||
} | ||
function retrieveRoutes (topLevelRouteStack, parentPath) { | ||
var allRoutes = []; | ||
var pPath = ""; | ||
if(parentPath) { | ||
if (parentPath === '/'){ | ||
parentPath = ''; | ||
} | ||
pPath = parentPath; | ||
} | ||
var routesArray = topLevelRouteStack.filter(function(stack){ // filter out middleware | ||
return stack.route || stack.handle.stack; | ||
}); | ||
routesArray.map(function(e){ | ||
var parentName; | ||
if (e.route){ // if no subrouter, just direct route | ||
if (e.route.path instanceof RegExp) { | ||
e.route.path = "/" + e.route.path.source.match(/\w+/ig).join("/"); | ||
} | ||
var route = { url: pPath + e.route.path, method: e.route.stack[0].method }; | ||
allRoutes.push(route); // add to route tree | ||
route.subRouter = pPath; // add subrouter path | ||
table.push(route); // add to route table | ||
} else if (e.handle.stack) { // if subrouter exists | ||
parentName = '/'; | ||
if (e.regexp.test('/')){ | ||
parentName = '/'; | ||
} | ||
else { | ||
// | ||
parentName = e.regexp.source.match(/\w+/ig).join("/"); | ||
} | ||
var parentPath = pPath + "/" +parentName; | ||
if (parentName === '/') parentPath = pPath; | ||
var route = { | ||
url: parentName | ||
}; | ||
route.children = retrieveRoutes(e.handle.stack, parentPath); | ||
allRoutes.push(route); | ||
} else { | ||
//Missed a case | ||
} | ||
}); | ||
return allRoutes; | ||
} | ||
} | ||
pathfinderUI.router = pfroute; |
{ | ||
"name": "pathfinder-ui", | ||
"version": "0.1.000000001111", | ||
"version": "0.1.1391", | ||
"private": false, | ||
"preferGlobal": false, | ||
"scripts": { | ||
"start": "node ./bin/www", | ||
"startmon": "nodemon ./bin/www" | ||
}, | ||
"author": "Cat, Sang, Ming, Tyler", | ||
@@ -18,15 +14,18 @@ "contributors": [ | ||
"name": "Sangmin Lee", | ||
"email": "poo@poo.com" | ||
"email": "sangmlee23@gmail.com" | ||
}, | ||
{ | ||
"name": "Ming Lei", | ||
"email": "doop@doop.com" | ||
"email": "mingus718@gmail.com" | ||
}, | ||
{ | ||
"name": "Tyler Perwarski", | ||
"email": "loop@loop.com" | ||
"name": "Tyler Pewarski", | ||
"email": "Tjp2122@gmail.com" | ||
} | ||
], | ||
"dependencies": { | ||
"angular": "^1.4.1" | ||
"angular-ui-router": "^0.2.15", | ||
"cli-table": "^0.3.1", | ||
"express": "^4.13.0", | ||
"lodash": "^3.10.0" | ||
}, | ||
@@ -33,0 +32,0 @@ "repository": { |
Pathfinder-UI | ||
========= | ||
A library that allows developers to visually test their routes. | ||
Pathfinder-UI is a tool that allows you to visualize and test the routes in an express application. | ||
TEST TEST TEST TEST | ||
## Installation | ||
```bash | ||
npm install pathfinder-ui --save | ||
``` | ||
## Usage | ||
```js | ||
var pfUI = require('pathfinder-ui') | ||
``` | ||
Blah blah blah blah ipsum lorsomething dolor darmok and jalad at tanagra | ||
This line attaches the Pathfinder interface to your express app. | ||
Place it before your routes/routers/middlewares | ||
```js | ||
app.use('yourCustomPath', pfUI.router) | ||
``` | ||
This function grabs your express routes and passes the data to our angular app | ||
Place this line after all of your routes/routers/middlewares. | ||
```js | ||
pfUI(app); | ||
``` | ||
You access the interface by going to localhost:PORT/yourCustomPath | ||
## Tests | ||
Blah blah blah blah ipsum lorsomething dolor darmok and jalad at tanagra | ||
## Contributing | ||
Blah blah blah blah ipsum lorsomething dolor darmok and jalad at tanagra. | ||
## Release History | ||
* 0.0.0 some version title stuff |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
94841
37
1280
36
4
2
+ Addedangular-ui-router@^0.2.15
+ Addedcli-table@^0.3.1
+ Addedexpress@^4.13.0
+ Addedlodash@^3.10.0
+ Addedaccepts@1.3.8(transitive)
+ Addedangular-ui-router@0.2.18(transitive)
+ Addedarray-flatten@1.1.1(transitive)
+ Addedbody-parser@1.20.3(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcli-table@0.3.11(transitive)
+ Addedcolors@1.0.3(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.7.1(transitive)
+ Addedcookie-signature@1.0.6(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedencodeurl@1.0.22.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedexpress@4.21.1(transitive)
+ Addedfinalhandler@1.3.1(transitive)
+ Addedforwarded@0.2.0(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedipaddr.js@1.9.1(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmerge-descriptors@1.0.3(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.0.02.1.3(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedon-finished@2.4.1(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.10(transitive)
+ Addedproxy-addr@2.0.7(transitive)
+ Addedqs@6.13.0(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.19.0(transitive)
+ Addedserve-static@1.16.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addedvary@1.1.2(transitive)
- Removedangular@^1.4.1