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

@r/mothership

v0.0.2

Published

launch @r/platform projects

Downloads

3

Readme

mothership

A set of tools for building isomorphic web apps with @r/framework. Provides a build system, server GUI, project generator, and some helpful utilities.

Example

mothership generate reddit-mobile
> generating project "reddit-mobile"...
> building directory structure...
  - README
  - server.js
  - client.js
  - config.js
  - middleware/
  - assets/
  - tests/
> generating package.json...
> installing npm modules...
> building initial packages...
Complete! Run `mothership launch` to run the server.

mothership launch
launching reddit-mobile at localhost:4444...
launched 4 processes.
launching repl...

reddit-mobile-app~$ debug web

Showing all logging for web requests...
GET / (80ms)

Installation

The easiest way to install is through NPM - just run npm install -g @r/mothership. This will add a binary, mothership, to your global node modules. If you want to use mothership's libraries, such as the build process, you can instead run npm install @r/mothership --save in your project. If installed locally, you can add npm scripts such as "start": "@r/mothership launch" to your package.json.

Alternatively, clone this repository and run npm install -g from the directory.

CLI Usage

mothership provides a binary for functions involving setting up and launching @r/framework applications.

generate

mothership generate will use a template to generate a new directory structure for a web project. It will set up a barebones application with one "Hello World" page, from which you can begin building your application. It will also run the first build for you, so you can launch the server and begin working immediately. It will not overwrite any existing files. It will run git init if git is available and there is not an existing repository.

Options

  • --bare does not set up any pages or routes; it will only create the directory structure and a minimal package.json file
  • --no-build skips the first build process
  • --dry-run will print out what the structure will be, but will not write any files.
  • --force will overwrite any existing, conflicting files.

Launch

mothership launch will launch a webserver. It runs in dev mode by default, which will watch for file changes and reload web servers, and will launch a terminal interface which includes a CLI and REPL.

Options

  • --no-interface turns off the terminal interface.
  • --no-watch turns off the filesystem watcher.
  • --server is an alias which combines both --no-interface and --no-watch.

Library Usage

mothership provides libraries to help build @r/framework applications.

Build

mothership.Build provides utilities for using webpack to build web applications.

Example

// compile.js

const { Build } = import "@r/mothership";
const options = {};

const build = new Build(options);
build.run();
build.watch();

Options

Build uses all standard webpack configuration options. Defaults are lised below:

const COMMON_CONFIG = {
  output: {
    path: path.join(__dirname, 'bin'),
    filename: "[name].js",
  },
  resolve: {
    extensions: ['', '.js'],
  },
  module: {
    loaders: [
      {
          test: /\.css$/,
          loader: ExtractTextPlugin.extract("style-loader", "css-loader")
      },
      {
          test: /\.less$/,
          loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: {
          presets: [
            'es2015',
            'stage-2',
            'react',
          ],
          plugins: [
            'transform-class-properties',
            'transform-runtime',
          ],
        },
      },
    ],
  },
  plugins: [
    new ExtractTextPlugin('[name].css'),
  ],
  postcss: [
    autoprefixer({
      browsers: ['last 2 versions'],
    }),
  ],
}