Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pathfinder-ui

Package Overview
Dependencies
Maintainers
5
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pathfinder-ui - npm Package Compare versions

Comparing version 0.1.1111 to 0.1.1391

lib/browser/css/prism.css

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

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