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

pikanen

v1.0.1

Published

a simple Express server, configurable from the command line (quick mocking tool). Generates an index file with express and serves it. Nothing you haven't seen before

Downloads

2

Readme

Pikanen

(Pikanen is finnish for ~quickie)

This is a very barebones Express server bootstrapper.

Similar to many quickstart servers, but with only a few dependencies and no extra bells or whistles.

Pikanen also generates a readable simple express index file, named pikanen-index.js, so it doubles as a simple express server generator.

  • All loose (no leading dashes) keywords are treated as directory paths, relative to current location.

  • Unknown dashed keywords raise errors.

Installation

pikanen is a node executable, install globally with npm install -g pikanen.

Usage

So, you have a new idea for a web feature that requires a server. Maybe a javascript framework is needed, so you have to serve the static app fragments/templates/whatever, and they all reside inside a www folder.

Pikanen is a simple tool for not having to look up an express tutorial for the basic setup every time you need to just get a very basic server up.

In the above situation, invoking pikanen www will create a basic node express server file for the specified directory

Oh no! You will still need to install express in your project folder via npm i express, after which, invoking pikanen will yield the called for result:

Success! You are now serving the contents of the directory at localhost:3000/www, as well as having created a file pikanen-index.js in the folder where you invoked the command, which can be used as a basis for more complex routing logic without having to look up the same Express tutorial boilerplate for the 100th time.

Parameter options:

Basic usage:

$ pikanen www serves /www from current directory at localhost:3000/www

Multiple directories:

  • $ pikanen www libs serves both /www and /libs from current directory under localhost:3000/www and localhost:3000/libs

Port: -p/--port

  • $ pikanen -p 8001 www serves /www from current directory at localhost:8001/www.

aliases:

  • Aliasing allows you to set aliases for directories with unwieldy names or long relative paths, like UI components inside a node_modules directory
  • $ pikanen /=node_modules/something/www serves directory /node_modules/something/www at localhost:3000/.

Root: -r/--root

  • should probably be called publicRoot or something, and allow the reverse too
  • $ pikanen -r api/v1 www serves directory /www at localhost:3000/api/v1/www. The root option changes the root of the whole server.

Silent: -s/--silent

$ pikanen -s www only creates the file without starting up the resulting servers

Configuration

The package can also run off a configuration placed in the local package.json file.

{
    "pikanen":{
        "silent":"false",
        "paths":["/=www", "assets=node_modules/somelib/dist"],
        "port":3001,
        "root":"/api"
    }
}

When you call pikanen in this directory, it will extract the configuration from package.json and use the variables set there.

Passed command line arguments will override the settings in the package.json, except paths, which will concatenate with the ones in the package file: