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

ssc

v0.0.9

Published

A simple static website compiler

Downloads

6

Readme

How to Run

Make sure to run the ssc command from the root directory of your project. (Install via npm)

TODO

  • Add a @link directive that links to a desired resource
  • When processing links, a '~' will get replaced by the root directory
  • Implement active states for the nav element
  • Fix title bug
  • Comments (Disqus)
  • Meta Data about pages (Title, author, date, tags, desired_url)
  • Grunt (to start)
  • Mark various links as active or not (Headers)

Notes

We need a differencing name for importing and placing.

  • Partials: @partial Is a chunk of code that gets imported into a page. If you do not specify an ID the name of the file will be used
  • Layout: @layout These are used to define the structure of a page. Automatically set by the folder, can be overwritten
  • Placing: @place Used in conjunction with @layout to place the content of a page. Automatically set by the folder, can be overwritten
  • Templates: Are handled by mustache {{}}. Every file is processed for these before being compiled
  • Link: @link If you are uncertain of a link path, you can use and let the compiler take care of it

Data: Is meta data of the file. It will get parsed out and tagged on to the file's object

  • Import: Anything withing these tags will get executed during the processing step. The scope will be the file object

Pages and Posts should live in the same list, you just filter them to get what you want

Assumptions:

  • Reading in a folder gives a default layout to all files within the folder. If the folder ends in 's/' (ie: anything plural) the trailing 's/' will be removed. For example, the 'posts/' folder will give a default layout of 'post'
  • Using Mustache.js for templates
  • Using less for css (or plain css)
  • All css / less will be compiled into one file as "styles.css". It will be available in 'css/styles.css'
  • The assets folder will be copied over untouched to the public folder
  • All folders will end in a / except the root folder ???

Reading Step 0. settings file 0. layouts folder 0. posts folder 0. pages folder 0. partials folder

Import Step 0. Loop through the layouts and load in their @partials 0. Loop through the posts and compile them bases on the post tmpl (or another if specified) 0. Loop through the pages and compile them bases on the pages tmpl (or another if specified) Process their imports if they have any 0. Process the index file for templates and imports

Compilation Step

Output Step

Paths...

Starting from the 'scripts/' folder

  • sitePathAbs: '/kaw2k.github.com/', Not sure why we need quite yet...
  • sitePathRel: '../../kaw2k.github.com/', Need to give a starting point to output all the files
  • rootPathRel: '../' Need to translate from the script folder location to the rest of the project
  • rootPathAbs:

Post Objects

  • id: unique identifier, defaults to [name]
  • rawName: The full file name 'test.md'
  • name: The trimmed name 'test'
  • extension: The trimmed extension 'md'
  • rawFile: A saved veresion of the raw file
  • file: The file as it gets processed
  • layout: Defaults to index if not specified by the file
  • title: The title of the post
  • date: The date of the post
  • tags: Any tags the post may have
  • urlName: The last part of the url, no extension, defaults to [name]
  • urlPath: What folder you want the file to live in defaults to passed in path