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

universal-javascript-vue

v1.3.14

Published

A fully-isomorphic (universal) ES6/ES7 boilerplate based on Vue.js

Downloads

38

Readme

Universal JavaScript - Vue

A fully-isomorphic (universal) ES6/ES7 boilerplate based on Vue.js.

For a more complete framework based on similar technologies, consider Nuxt. If you are looking for something more nuts-and-bolts, and/or are interested in the additional features offered, then you came to the right place.

When to use this

Some of the possible reasons to choose this over something else:

  • If you want a fully-isomorphic (universal) boilerplate that isn't too abstracted, is simple to understand, and can easily and quickly be adapted to your needs (nuts-and-bolts).
  • If you have tried (or looked into) these, but found them too abstracted, or require too much boilerplate code:
  • If you don't want to use React / Redux (see this comparison guide)

Features

The following features are centralized, meaning they run both client-side and server-side:

  • Centralized routing using vue-router, with a strong focus on code-splitting (JS+CS+HTML components)
  • Centralized state management using Vuex, and DOM hydration using vuex-router-sync
  • Centralized API interface with ready-to-go data prefetching and a built-in mock server using JSON Server.

In addition:

  • Full Babel support
  • Full Vue support
  • Full Hot reloading (HMR) support
  • Full CSS Modules support, with SASS integration
  • Full PostCSS integration, with cssnext and cssnano support
  • (optional) Full Foundation integration
  • (optional) Full Font Awesome integration
  • (optional) Full content management system (CMS) built on KeystoneJS, including API routes for authenticating and retrieving data
  • Webpack 2 integration, with the following chunk optimizations:
    • Extracts all vendor dependencies (i.e. node_modules) into a separate chunk for better caching
    • Extracts the webpack runtime and manifest into a named chunk to avoid hash changing on every build
  • Support for priority asset resource prefetching / preloading
  • Automatically inlines the CSS necessary to render the components served by each chunk
  • Optimized production bundling that does the following:

Architecture Overview

A detailed Vue SSR guide can be found here.

Installation

Requires Node.js 6+

Install the Yeoman generator:

npm install -g yo
npm install -g generator-universal-javascript-vue

If using KeystoneJS, you must also install MongoDB.

Scaffold new projects using the generator:

mkdir my-project; cd my-project
yo universal-javascript-vue

Building and serving the app

# serve in dev mode, with hot reload at localhost:3000
npm run dev

# build for production
npm run build

# serve in production mode
npm start

If using KeystoneJS (yeoman generator option):

When serving in production mode, the assumption is that a mongo instance is already running, at the url specified by config/keystone.config.js:

module.exports = {
  // ...
  'mongo': 'mongodb://localhost:27017/' + pkg.name,
  // ...
};

You can also launch the a local mongo instance using:

npm run db

Simply an alias for mongod

Configuration

The following config properties (config/index.js) are recognized by the boilerplate:

module.exports = {
  title: 'Universal JavaScript - Vue',
  port: process.env.PORT || 3000,
  api: {
    base: '/api',
    mock: false
  },

  // only applicable if using Foundation (yeoman generator option)
  foundation: {
    plugins: [] // JS plugins to bundle with the client
  }
};

Additionally, the following configuration files are consumed:

  • config/webpack.client.config.js - used for building the client bundle (extends webpack.base.config)
  • config/webpack.server.config.js - used for building the server bundle (extends webpack.base.config)
  • config/keystone.config.js - configuration passed to KeystoneJS, if enabled
  • postcss.config.js - configuration past to PostCSS

License

MIT