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

xpress-shotgun

v1.0.34

Published

![shotgunlogo1](https://user-images.githubusercontent.com/31411569/34085495-c7f82124-e35f-11e7-97de-f0a36cd80ad2.png)

Downloads

29

Readme

shotgunlogo1 npm version

xpress-shotgun

ezgif com-video-to-gif 1

xpress-shotgun is a npm module that shotguns an express MVC to your specified directory

  • a directory will be made along with the model, with methods and sql commands already embedded the controller & the views

  • you will have a full crud express app, all you have to do is create a database, a node server, & fll out views to your liking

  • shotgun also takes care of the npm init & installs ejs(viewengine) and pg-promise(more info below)

before use INSTALL bash

Bash version can be queried with the --version flag:

bash --version

output -> 3.2.53(1)-release

The actual installation is going to happen with HomeBrew, the OS X package manager, if you don’t have it, installed it with the following command:

1) ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update homebrew packet database and install bash:

2) brew update && brew install bash

Add the new shell to the list of allowed shells

3) sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'

Change to the new shell

chsh -s /usr/local/bin/bash 

Now close terminal and open again

installation

install shotgun GLOBALLY:

npm install -g xpress-shotgun 

once installed run:

shotgun nameofapp dbname modelname(capital) controllername(plural) singularRESPONSE

dependecies

"ejs": "^2.5.7",
"express": "^4.16.2",
"pg-promise": "^7.0.3"

PG promise

PG-PROMISE grants you accesss to DB query methods

  • Automatic connections
  • Automatic transactions
  • Powerful query-formatting engine
  • Support for ES6 generators and ES7 async/await
  • Declarative approach to handling query results
  • Global events reporting for central handling
  • Extensive support for external SQL files
  • Support for all promise libraries

examples

  • Simple SELECT

ES5

db.any('SELECT * FROM users WHERE active = $1', [true])
    .then(function(data) {
        // success;
    })
    .catch(function(error) {
        // error;
    });

ES6

try {
    const users = yield db.any('SELECT * FROM users WHERE active = $1', [true]);
    // success
} 
catch(e) {
   // error
}

ES7

try {
    const users = await db.any('SELECT * FROM users WHERE active = $1', [true]);
    // success
} 
catch(e) {
    // error
}

ejs

Features

  • Control flow with <% %>
  • Escaped output with <%= %> (escape function configurable)
  • Unescaped raw output with <%- %>
  • Newline-trim mode ('newline slurping') with -%> ending tag
  • Whitespace-trim mode (slurp all whitespace) for control flow with <%_ _%>
  • Custom delimiters (e.g., use instead of <% %>)
  • Includes
  • Client-side support
  • Static caching of intermediate JavaScript
  • Static caching of templates
  • Complies with the Express view system

Examples

<% if (user) { %>
  <h2><%= user.name %></h2>
<% } %>
Try EJS online at: https://ionicabizau.github.io/ejs-playground/.

Usage

var template = ejs.compile(str, options);
template(data);
// => Rendered HTML string 
 
ejs.render(str, data, options);
// => Rendered HTML string 
 
ejs.renderFile(filename, data, options, function(err, str){
    // str => Rendered HTML string 
});