Git Product home page Git Product logo

singlizer's Introduction

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",
      "https://awesomejs.com/dist/whatever/sweet.min.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.

Added in 0.1.2: jsFiles can now include a url if you'd like.

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>

singlizer's People

Contributors

jamesmskelsey avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.