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

singlizer

v0.1.2

Published

Create a single file from an html file that only contains the content of a 'body' tag, a main css file, and any number of js files. Files are specified through a 'singlizer.json' config file.

Downloads

7

Readme

Singlizer

What it's for

Use single.js to combine a single html file that contains only the contents of a body element (minus the tags), a single 'main.css' file, and any number of javascript files, specified through singlizer.json.

This may only be useful for me, because I have a specific need to distribute files to coworkers who are Sailors, whose email system will strip any .zip files I send them. They have a ridiculously bad internet connection, the need for tools that are normally only available online, or are developed for them for some specific task they need to do.

However, I suppose it might be useful for a student submitting projects to a class. I wouldn't know, I've never taken a class before.

Installation

Use npm i -g singlizer to install singlizer globally. Run singlizer init in a folder to create a config file. Has no dependencies. Should not be depended on for anything. Run singlizer to "compile" your files.

Configuration

  {
    "title": "Singlizer",
    "jsFiles": [
      "main.js"
    ],
    "cssFile": "main.css",
    "htmlFile": "index.html",
    "outputPath": "./dist/",
    "outputFileName": "index.html"
  }

"jsFiles" must be an array of JavaScript files. It can include files in subfolders, don't forget './' All of the config entries are optional, but setting them to blank files will cause problems.

Usage

Use singlizer init to create an initial configuration file in the folder you are working in. Modify it to fit your needs.

Example files.

singlizer.json

  "title": "Hello, world",
  "jsFiles": ["./js/main.js"]

./index.html

  <p>Hello, world</p>

./js/main.js

  console.log("Hello, world");

./main.css

  body {
    background-color: #eee;
    color: #222;
  }

Then, type: singlizer

Outputs:

  <!DOCTYPE html>
  <html>
    <head>
      <title>Hello, world</title>
    </head>
    <body>
      <p>Hello, world</p>
      <style>
        body {
        background-color: #eee;
        color: #222;
      }
      </style>
      <script>
        console.log("Hello, world");
      </script>
    </body>
  </html>