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

asset-pipe-build-server

v2.2.0

Published

Asset pipe build server

Downloads

25

Readme

Greenkeeper badge

Usage

Install

npm install asset-pipe-build-server

Configure

Configuration of the server is done via environment variables.

The following configuration options are available:

| Variable | Description | Options | Default | |-----------|-----------------------------------------------------|--------------------------|-------------| | NODE_ENV | Applicaton environment | development, production | development | | LOG_LEVEL | Which level the console transport log should log at | debug, info, warn, error | debug | | PORT | The port the server should bind to | - | 7100 |

Start

asset-pipe-server

OR with configuration options:

PORT=3321 LOG_LEVEL=info NODE_ENV=production asset-pipe-server

Endpoints

The server provides the following endpoints:

| Verb | Endpoint | Description | url params | payload | response | |------|--------------|------------------------------------------|------------|--------------|-------------------| | POST | /feed/js | Upload a javascript asset feed | - | js feed | feed response | | POST | /feed/css | Upload a css asset feed | - | css feed | feed response | | GET | /feed/:id | Download an asset feed | feed id | - | feed | | POST | /bundle/js | Request bundling of a list of js feeds | - | js bundle | bundle response | | POST | /bundle/css | Request bundling of a list of css feeds | - | css bundle | bundle response | | GET | /bundle/:id | Download an asset bundle | bundle id| - | bundle |

See below for explanation and additional detail regarding the various url params, payloads and responses.

Url params

feed id

A js or css feed filename. (Depending on endpoint)

Examples

GET /feed/js/acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json
GET /feed/css/bcd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json

bundle id

A js or css bundle filename. (Depending on endpoint)

Examples

GET /bundle/js/acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json
GET /bundle/css/bcd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json

Payloads

js feed

An array of feed objects as produced by asset-pipe-js-writer

Example

[
    {
        "id":"c645cf572a8f5acf8716e4846b408d3b1ca45c58",
        "source":"\"use strict\";module.exports.world=function(){return\"world\"};",
        "deps":{},
        "file":"./assets/js/bar.js"
    }
]

css feed

An array of feed objects as produced by asset-pipe-css-writer

Example

[
    {
        id: '4f32a8e1c6cf6e5885241f3ea5fee583560b2dfde38b21ec3f9781c91d58f42e',
        name: 'my-module-1',
        version: '1.0.1',
        file: 'my-module-1/main.css',
        content: '/* ... */'
    }
]

js bundle

An ordered array of js feed filenames.

Example

[
    'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json',
    'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json',
    'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json'
]

css bundle

An ordered array of css feed filenames.

Example

[
    'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json',
    'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json',
    'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json'
]

Responses

feed response

After a feed is uploaded, the server will respond with a json body containing the keys file and uri where file is the name of the feed file that was saved on the server and uri is the same as file but with the server address prepended.

Example

{
    file: 'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json',
    uri: 'http://127.0.0.1:7100/acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json'
}

feed

Feed is the original js or css feed content that was saved on the server during a feed upload (via POST /feed/js or POST /feed/css)

Example

[
    {
        "id":"c645cf572a8f5acf8716e4846b408d3b1ca45c58",
        "source":"\"use strict\";module.exports.world=function(){return\"world\"};",
        "deps":{},
        "file":"./assets/js/bar.js"
    }
]

bundle response

After a bundling is complete, the server will respond with a json body containing the keys file and uri where file is the name of the file for the bundled content that was saved on the server and uri is the same as file but with the server address prepended.

Example

{
    file: 'acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json',
    uri: 'http://127.0.0.1:7100/acd1ac21dac12dac12dac12dac1d2ac1d2ac1d2a.json'
}

bundle

Bundle is a piece of bundled javascript or css content.

Contributing

The contribution process is as follows:

  • Fork this repository.
  • Make your changes as desired.
  • Run the tests using npm test. This will also check to ensure that 100% code coverage is maintained. If not you may need to add additional tests.
  • Stage your changes.
  • Run git commit or, if you are not familiar with semantic commit messages, please run npm run cm and follow the prompts instead which will help you write a correct semantic commit message.
  • Push your changes and submit a PR.