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

@polymer-tools/polyserve

v1.0.0

Published

A simple dev server for bower components

Downloads

21

Readme

Build Status NPM version

polyserve

A simple development server for web projects.

polyserve serves project files from a URL root that allows relative URLs that reach out of the project, like those starting with ../, to work. This is necessary for referencing other packages by path when stored as a flat directory such as how Bower works.

The local package is served at the URL /components/{bower-name}/, with files served from the current directory. Other packages are served at /components/{packageName} with files served from their directory under ./bower_components/.

Installation

$ npm install polyserve -g

Usage

Run polyserve

$ cd my-element/
$ polyserve

Browse files

Navigate to localhost:8080/components/my-element/demo.html

Options

  • --version: Print version info.
  • --root string: The root directory of your project. Defaults to the current working directory.
  • --compile string: Compiler options. Valid values are "auto", "always" and "never". "auto" compiles JavaScript to ES5 for browsers that don't fully support ES6.
  • --module-resolution string: Algorithm to use for resolving module specifiers in import and export statements when rewriting them to be web-compatible. Valid values are "none" and "node". "none" disables module specifier rewriting. "node" uses Node.js resolution to find modules.
  • --compile-cache number: Maximum size in bytes (actually, UTF-8 characters) of the cache used to store results for JavaScript compilation. Cache size includes the uncompiled and compiled file content lengths. Defaults to 52428800 (50MB).
  • -p, --port number: The port to serve from. Serve will choose an open port for you by default.
  • -H, --hostname string: The hostname to serve from. Defaults to localhost.
  • -c, --component-dir string: The component directory to use. Defaults to reading from the Bower config (usually bower_components/).
  • -u, --component-url string: The component url to use. Defaults to reading from the Bower config (usually bower_components/).
  • -n, --package-name string: The package name to use for the root directory. Defaults to reading from bower.json.
  • --npm: Sets npm mode: component directory is "node_modules" and the package name is read from package.json
  • -o, --open: The page to open in the default browser on startup.
  • -b, --browser string[]: The browser(s) to open with when using the --open option. Defaults to your default web browser.
  • --open-path string: The URL path to open when using the --open option. Defaults to "index.html".
  • -P, --protocol string: The server protocol to use {h2, https/1.1, http/1.1}. Defaults to "http/1.1".
  • --key string: Path to TLS certificate private key file for https. Defaults to "key.pem".
  • --cert string: Path to TLS certificate file for https. Defaults to "cert.pem".
  • --manifest string: Path to HTTP/2 Push Manifest.
  • --proxy-path string: Top-level path that should be redirected to the proxy-target. E.g. api/v1 when you want to redirect all requests of https://localhost/api/v1/.
  • --proxy-target string: Host URL to proxy to, for example https://myredirect:8080/foo.
  • --help: Shows this help message

Compiling from Source

$ npm install
$ npm run build

You can compile and run polyserve from source by cloning the repo from Github and then running npm run build. Make sure you have already run npm install before building.

Run Tests

$ npm test