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

flim

v0.0.2

Published

Lightweight, static page generator

Downloads

4

Readme

Flim

Build Status

Flim is a lightweight static page generator for bloggers.

Installation

npm install flim

Opinions

  • Do one thing and do it well.
  • Be fast
  • Be small and nimble
  • Delegate build tasks and to other modules / tools.
  • Be friendly to JavaScript data types
  • Highlight.js is better than Pygments
  • JSON not YAML

The examples directory should give you a feel for this.

Usage

Programmatic use

var flim = require('flim');
flim.init(function(err, data) {
  if (err) { throw err };
}); 

Command line use (assuming global install)

flim generate

Folder Structure

Flim expects sites to have a src folder containing _layouts and _posts folders.

src
├── _layouts
│   ├── index.jade
│   ├── layout.jade
│   ├── post.jade
│   └── tag.jade
└── _posts
    ├── post-1.md
    ├── post-2.md
    ├── post-3.md

Generated structure

Flim generates into a build folder. Flim is opinionated about the structure of the site that is generated

build
├── atom.xml
├── index.html
├── post-1
│   └── index.html
├── post-2
│   └── index.html
├── post-3
    └── index.html
├── sitemap.xml
└── tags
    ├── tag1
    │   └── index.html
    ├── tag2
    │   └── index.html

Configuration

You can customise flim using a .flimrc file in the root of your flim site. This is JSON with the following options.

{
  "site_name": "A flim site",
  "src_dir": "./src",
  "build_dir": "./build",
  "tags": {
    "tags_dir": "tags",
    "template": "./src/_layouts/tag.jade"
  },
  "pages": {
    "index": {
      "title": "Home",
      "meta": {
        "description": "My description",
        "keywords": "foo, bar, baz"
      },
      "template": "./src/_layouts/index.jade"
    },
    "posts": {
      "template": "./src/_layouts/post.jade"
    }
  }
}

Posts Structure

Posts are written using vanilla markdown and use JSON for metadata. GitHub markdown is supported.

{
  "layout": "post",
  "title": "Praesent urna lectus",
  "description": "Lorum dorum ipsum",
  "date": "Thu Jan 24 2013 16:32:12 GMT+0000 (GMT)",
  "tags": ["alpha", "beta", "gamma"]
}

# Praesent urna lectus

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla a sapien quam. Vestibulum rutrum mauris sed nisl condimentum sed tempus metus pulvinar. Donec porta suscipit arcu ut hendrerit. Proin lobortis sodales metus, id pretium dui ultrices ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 

Tasks

Flim delegates build tasks other than generating pages to other tools since you know best how you want to build and dpeloy your site. A Makefile or Grunt are recommended for copying files, minification and deployment. The examples folder contains sites with both of these tools. A more complex build process can be seen in the shapeshed.com repository.