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

pitch-cli

v0.11.0

Published

Zero-Configuration Convention-Driven Progressive Static Site Generator.

Downloads

10

Readme

The objetive of pitch is to provide a powerful tool capable of building static websites progressively. Just a src folder should be enough to build a static website.


| Linux | Windows | |-|-| |CircleCI|AppVeyor|

Install

npm install -g pitch-cli

Usage

Create a file structure like this:

MyWebsite/
    src/
        index.html
        style.css

Running pitch serve inside MyWebsite will run a web server in http://127.0.0.1:3000. Access it from the browser check that it's working.

Now change the index.html extension to .ejs and the style's to .scss, change the contents of the files, add new styles and reference them from index.ejs, or create some partials.

As you can see, pitch takes care of building the needed resources as you request them. It just works.

Data

To include data into your website, just create a data folder with some JSON files in it:

MyWebsite/
    src/
        index.ejs
        style.scss
    data/
        people.json

Inside people.json:

["John", "Charles", "Thomas"]

Inside index.ejs:

<p>People: <%= data.people.join(", "); %></p>

And that's all you need to do to include data into your website. Change any file's contents and reload the page in the browser, it gets re-compiled automatically.

The data proxy is able to navigate into folders too.

MyWebsite/
    data/
        articles/
            helloWorld.md
<article>
    <%- data.articles.helloWorld.html %>
</article>

Pitch understands many file formats inside it's data folder:

  • .json: Gets JSON.parse()'d.
  • .js: Gets require()'d.
  • .md: Parsed with remark.

If the file isn't any of these formats, will read it like a plain text file.

Router

Documentation is on the way.

Why

Got really tired of configuring stuff to build a simple website that I need right now because whatever.

Regular static site generators tie you to 'blogs' or websites with pages. Wanted something that isn't oriented to a certain type of website and gave me everything I needed, instead of requiring some extra build tasks to transpile something.

Also, many of them require you to have a default configuration file, when a single index.html should be enough.

Thought that gluing together a template system with some css pre-processing inside a CLI tool should do the trick. And it did.