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

express-genie

v2.1.4

Published

This library was made for automating repetitive express routines. Made by Syed Abrar Ali and Jawad Shaikh

Downloads

9

Readme

Logo

This is a Node.js module available through the npm registry.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

  npm install express-genie --save-dev

After installing, run:

  npm run setup

After running this command you should see the following files created in root directory:

  • server.js //entry point for project
  • app.js
  • .env
  • .env.development
  • .env.staging

and folders:

  • config
  • middleware
  • constants

also your package.json file will also be updated to include scripts and dependencies and will look like:

  "scripts": {
    "setup": "node ./node_modules/express-genie/index.js",
    "dev": "set NODE_ENV=development&& nodemon server.js",
    "stage": "set NODE_ENV=staging&& nodemon server.js",
    "deploy": "node server.js"
  },
"dependencies": {
    "joi": "^17.9.1",
    "express": "^4.18.2",
    "cors": "^2.8.5",
    "dotenv": "^16.0.3",
    "mysql2": "^3.1.2"
  },
  "devDependencies": {
    "express-genie": "^1.3.0",
    "nodemon": "^2.0.22"
  }

npm run setup will only work once, meaning if you have run it once, it will not have any effect the next time you run this command. Run npm install to install the dependencies

  npm install

Now you are good to go and have a basic express structure ready.

Run npm run setup auth to create auth routes and all its folders.

Five new folders will be created,

  • routes //for route handling
  • controllers //for handling response
  • services //for business logic
  • validations //incoming request validations
  • helpers //helping functions

and app.js file will be updated to include the new created route. Remember to install the new dependencies added in package.json file by running npm i

Auth will have four routes

  • sign-up
  • login
  • forgot-password
  • reset-password

To create a new entity route and all its respective folders run npm run setup [entityName] without square brackets

  npm run setup [your entity name here]

Every entity route will have five routes

  • get-all
  • get-single
  • create
  • update
  • delete

For every new entity route just run the previous command with replacing the entity name. Enjoy!

Authors

Contributing

Contributions are always welcome! Feel free to contact us if you find any bugs or have any suggestions

License

MIT