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

waffer

v1.3.13

Published

Waffer is a pre-designed MVC server

Downloads

66

Readme

Waffer

Waffer is a pre-designed MVC server

Install

There is a repo for cli wafferjs/waffer-cli

$ npm install -g waffer-cli

Usage

See waffer-cli usage

Features

Vue frontend

By default Vue.js and vue-router are used for rendering the website.

Custom components

Custom components are shared between views. Base project ships with two custom components which are used in every view to handle errors: error-handler and error

Easiest way to create components in waffer is to run waffer component <name> in directory of the project.

Note that to append custom components to your view you have to add proper tags to your pug template

html
  head
    link(href='/components.css', rel='stylesheet')
    // ...

  body
    // ...
    script(src='/components.js')

View files linking

By default all assets are taken from the assets/static/ directory of your project.

Every url that starts with @ represents a file from current view — i.e.

# request scripts/app.js of the current view
http://example.com/@scripts/app.js # `/` is equal to `/index/` view
http://example.com/my-view/@scripts/app.js

To access another files of another view you can request them from /view-name/file. If requested file is not found it will be redirected to assets/static/ + view-name/file of the root of your project.

Two routers

There are two routers one on the server side and one on the client side

https://example.com/main-view/sub-view/

Server side router

Server side router handles main views — i.e.

https://example.com/users/
https://example.com/posts/

These routes are defined by your view structure in the views/ directory of your project. The easiest way to create a new view is to run waffer view <name> inside your project directory.

Server side views can be totally different from each other. You can serve single index.pug file or a full blown view with client routing from the template.

Client side router

Client side router handles all sub-views — i.e.

https://example.com/users/wvffle/
https://example.com/posts/123/

To define a route you have to add an entry to @scripts/routes.js with subview url as a key and a template file as a value

export default {
  '/users': 'templates/users',
  // ...
}

You can also name the routes by passing an array with the template as the first element and name of the route as the second one

export default {
  // ...

  // add a name to the 404 route
  // to later get current route name in the code
  '*': [ 'templates/404', 'notfound' ],
}

Async template loading

Since we have a client router we should not include templates with all of the components of the routes. The size of the app.prod.js would be massive if we did that.

These templates are loaded asynchronously as the subview is requested. By default they stay inside @templates/ directory.

Preprocessors!

Yup, here they are!

We chose to use pug, stylus and bublé but we are open to add support for more than just these three