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

coderoom

v0.6.0

Published

Code snippets preview generator

Downloads

19

Readme

Coderoom Build Status codecov coverage

Screenshot

About

Coderoom helps you build live presentation of your numerous html/css/js code snippets.

For instance, you have a project with specific GUI-guidelines, custom widgets, tricky workarounds, which you want to share with your team or customers. With coderoom you can easily gather these pieces into single resource. Also, thanks to coderoom, you can monitor how changes in project influence it's specific parts that you have allocated.

Demo

Features

  • works offline
  • builds live examples that are easy to use and share
  • uses folder structure to arrange things
  • resource nesting (child "room" inherits configuration of it's parent)

Installation

npm install coderoom -g

Usage

To generate coderoom you have to prepare a folder with at least one html file. Then run a command:

coderoom source/ target/

If you use coderoom as a dependency:

const coderoom = require('coderoom');
coderoom.build('source/', 'target/');

Now target folder contains index.html. Open it in browser to see your built coderoom.

Grouping

You can group your snippets. To do that just place them in a separate folder inside of your source folder.

Ordering

Coderoom orders content alphanumerically, just like your operation system does to files and folders. It means, that if your source folder contains files: Question.html and Answer.html, first will be Answer.html and then Question.html.

To change this you can name files and folders, so they contain double-underscore __, like 1__Question.html and 2__Answer.html. Coderoom drops prefixes before __ from titles on a view, but they still can be used to arrange items in a way you want.

Resources

Of course, html worth nothing without css and javascript (also images, fonts, etc but it's not a point). To bring life into your snippets, add config.json file to your "room" folder with media property. media contains an array of glob patterns, like ['./myProject/css/*', './myProject/js/*'], that when resolved are included into presentation.

Also, config.json may contain assets property with file patterns, that are not included directly, but are copied along with media files. All files are copied to coderoom build with relatedness preservation. It means, that if your css file contains relative path, like background-image:url('../images/logo.png');, and you didn't forget to include images folder into assets, it is guaranteed to work.

File patterns are resolved relatively to current working directory.

Each group of snippets may contain own config.json. If parent folder has ['./foo.js'] configured as media, and child has ['./bar.js'], then child "room" will contain both foo.js and bar.js, while parent will contain only foo.js.

config.json

| Name | Type | Description | |--------|--------------|------------------------------------------------------------------------------------------------------| | title | string | Set "room's" title. By default folder name is used | | media | array/string | Glob patterns of .css and .js files, that will be included into view | | assets | array/string | Glob patterns of files that will not be included into view, but will be copied beside to media files |

Example:

{
  "title": "My awesome project",
  "assets": [
    "./vendor/bootstrap-*/**/*"
  ],
  "media": [
    "./vendor/jquery-*.min.js",
    "./vendor/bootstrap-*/css/bootstrap.css*",
    "./vendor/bootstrap-*/js/bootstrap.js",
    "./css/foo.css"
  ]
}

Complex preview

If you want to include in preview more than just html, you have to create a folder with index.html in it. Place any css or javascript files into that folder, they will become a part of a "room", and you'll be able to switch between them on live presentation.

Automation