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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mvccreate

v2.0.8

Published

A module script to create a default MVC pattern folder and file structure.

Downloads

6

Readme

MVC Create - An MVC Structure Builder

PURPOSE

INSTALL

npm i mvccreate

Recommended Usage

Most Basic install.js File:

const mvcCreate=require("mvccreate");
mvcCreate.mvcCreate();

Note: This will create all of the folders and files, with the option of creating a package.json. Here is what the default tree will look like:

- controllers
- - homeController.js   
- models
- - homeModel.js
- public
- - css
- - images
- - js
- views
- - index.html
- main.js
- routes.js
- package.json (you will be provided an option to customize or skip)
- README.md
- .gitignore

Hint

npm i mvccreate
echo const mvcCreate=require("mvccreate"); >install.js
echo mvcCreate.mvcCreate(); >>install.js
node install.js

CUSTOMIZATION

What if you want to build a slightly different MVC pattern or even another structure? No problem. Version 2.0+ allows you to add your own patterns. If you want to use your own package.json, just skip the creation step. Just define the pattern you want as follows:

const mvcCreate=require("mvccreate");

//Define dev-dependencies as an object (if you are not using your own package.json):
userDevDepsObj={
  "mvccreate": "*",
  "nodemon": "^2.0.4"
}

//Define regular dependencies as an object (if you are not using your own package.json):
userDepsObj={
  "express": "^4.16.3",
  "express-es6-template-engine": "^2.2.3"
}

//Define a folder structure:
userDirs=[
  "config",
  "public",
  "public/images",
  "public/js",
  "public/css",
  "funny",
  "views",
  "controllers",
  "models"
];

//Define files matching the folder structure:
userFiles=[
  "main.js",
  "router.js",
  "weird.js",
  "funny/iJustWantThisOneOkay.js",
  "views/index.html",
  "models/homeModel.js",
  "controllers/homeController.js",
  "README.md",
  ".gitignore"
];

//Feed these to mvcCreate for breakfast:
mvcCreate.mvcCreate(userDevDepsObj, userDepsObj, userDirs, userFiles);

userFiles=[
  "main.js",
  "router.js",
  "utils.js",
  "weird.js",
  "funny/iJustWantThisOneOkay.js",
  "views/index.html",
  "models/homeModel.js",
  "controllers/homeController.js",
  "README.md",
  ".gitignore"
];
mvcCreate.mvcCreate("", "", "", userFiles);

PROMPT

NPM VERSIONS npmjs.com

1.0.6 - This version was an early development of the process.

2.0.0 - This version enables user defined patterns and a package.json creation process similar to 'npm init' but with more features.

NPM Listing: https://www.npmjs.com/package/mvccreate

KNOWN BUGS