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

backpack-factory

v0.1.10

Published

> Inspired by [backpack](https://github.com/jaredpalmer/backpack), made industrial.

Downloads

4

Readme

BackpackFactory - Core

Inspired by backpack, made industrial.

The Backpack Factory is a building tool using using webpack. It is made to be very flexible and super light. The main goal is to have the factory installed globally with all the useful packages and configurations, and then using it in any project on your system.

Table of Contents

How to use

First you need to install the core of factory:

npm install -g backpack-factory

Then you need to set up some patterns in the ./patterns directory. You will find many patterns in this github. For instance you can get base pattern.

Go to your local project and add some scripts to your ./package.json:

"dev": "backpack-factory dev",
"build": "backpack-factory build",

Create a configuraton file named ./factory.config.js, (note that if you are using the base-pattern, this file is optionnal).

module.exports = {
  pattern: 'base-pattern'
}

Then you can create the entry file for your application, by default, it should be ./src/main.js

Then run npm run dev and enjoy!

Configuration files

You can create configuraton files in your local project or in patterns directories. They must be called ./factory.config.js. There is no specific requirement for them but here are some default properties:

module.exports = {
  pattern: String, // Name of the pattern your using
  patterns: [String], // You can also pass an array of patterns.

  webpack: { // The webpack config to be passed to webapck for building
    // ...
  },

  updateConfig: function (config, webpack) { // A function to update dynamically the configuration
    // ...
    return config // /!\ Important
  },

  scripts: { // scripts that can be run using backpack-factory run scriptName
    dev (config, webpack) {
      // ...
    },
    build (config, webpack) {
      // ...
    },
    custom (config, webpack) {
      // ...
    }
  }
}

The config object will be initialized as { env: 'development' } (or { env: 'production' }) and then will go through all patterns you requested and finally through the local configuration. Each time, it will be merge (recursively) and the function updateConfig will be call on it (if the function is defined).

At the end the scripts will be given the full config object, so they may use the webpack property to feed a webpack compiler.

Patterns

A Pattern is a directory named after the pattern's name. It can contained pretty much anything, but mostly configuraton files ./factory.config.js and a list of dependencies in a ./package.json file. Note that modules installed in the patterns will be requirable in your local project.

Look for the basic patterns to have some examples.

CLI Commands

backpack-facrory run [scriptName]

This command is the one launch scripts from your pattern. Just type backpack-factory run scriptName to call scripts.scriptName.

backpack-factory build and backpack-factory dev are shortcuts for backpack-factory run build and backpack-factory run dev.

backpack-facrory get [patternName]

This command allows you to add pattern to the factory to be used later. For instance type backpack-facrory get base-pattern to download and setup base pattern.

FAQ

None yet

Todos

  • Test it all