npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

folder-mapper

v1.0.15

Published

Map your application from app base file or from a given directory

Readme

folder-mapper

Map your application from app base file of from a given directory. This map is created following a MEAN stack based on JAVA development structure.

Structure example:

+ app
  + controllers
    + api
      - dogs
      - cats
    + mqtt
      - broadcast
    + websocket
      - chat
  + models
    - dog
    - cat
    - message
  + services
    - dogs
    - cats
    - messages
+ config
  - config
  - mqtt
  - routes
  - websocket
- app.js

Example:

map = {
 app : {
  controllers : {
   api : {
    dogs : "route_to_your_application/app/controllers/api/dogs.js"
(...) 

Install and import

npm install --save folder-mapper
var map = require('folder-mapper');

Usage:

When you use any function given by the map handler an internal object is created with the folder structure and absolute routes of the files in your application. This object is stored for fast interaction.

Functions:

map.map(<your_route>)

this function returns a personal map of the requested folder. Is commonly used as map.map(__dirname) to know about the same file location.

At the moment of creating the object, the function gets the application running environment. In case it is the normal application, it stores de object from the app.js file, if it is from application/server or application/dist/server (for production environments). In case it is a test environment (mocha, karma, jasmine) it stores the object from the app.js file located in application/server, to make the requires in every file be able to pass the tests.

map.map() or map.map('app')

this function returns the full app object, based on your environment. This javascript object can be used and iterated as a JSON object.

map.getModel()

map.getService()

map.getController()

these functions give the route to the file located in the package for the end route given.

example: map.getModel('dog') => route_to_your_application/app/models/dog.js example: map.getModel('bigger_application/dog') => route_to_your_application/app/models/bigger_application/dog.js

map.getConfig()

this function gives the route to the configuration file requested

example: map.getConfig('config') => route_to_your_application/config/config.js