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

layer-terminal

v1.1.3

Published

A command-line tool to change the GNOME terminal background from Jade templates and JSON data.

Downloads

3

Readme

Layer

A command-line tool to change the GNOME terminal background from Jade templates and JSON data.

Simple example

With the Jade template:

html
  head
    style.
      body {
        background: black;
        color: white;
      }

      h1 {
        float: right;
      }
  body
    h1 Hello, #{test}

and JSON:

{
  "test": "layer"
}

renders the output:

layer-render

Why

Layer makes it possible to programmatically change the terminal background as a way of providing information without disrupting your workflow. For example, it can be used:

  • To notify you that a long-running script has finished (see the provided 'notifications' template)
  • As an in-your-face todo list (see the provided 'todo' template)
  • As a reference for keyboard shortcuts that you do not yet know

Installation

Using npm:

npm install -g layer-terminal

If you don't have phantomjs installed, this is also required:

sudo apt-get install phantomjs

To enable tab completion, then do:

layer completion >> ~/.bashrc

Usage

layer <command> [options]

Commands

new

Arguments: -t/--template

Stores a named reference to the Jade and JSON files specifed. The created template reference can be set as the default template using the config command.

render

Arguments: -t/--template --profile, --allow-scroll, --image-file, --column-width, --row-height

Render a template to the terminal background. The exact Jade and JSON files can be specified, as can the location for the background image to be saved.

In addition, some terminal properties can be specifed or set: the GNOME profile whose background to change, whether the image scrolls when the terminal scrolls and the mapping between row/column sizes and pixels (to ensure the image is scaled to fit the terminal correctly).

write

Arguments: -k /--key, -v/--value, -t/--template

Write some JSON or a string to a particular key within an object in the data for a template, then render that template. For example, with the template data:

{
    "test": {}
}

layer write -k test.child -v success updates the template to:

{
    "test": {
        "child": "success"
    }
}

append

Arguments: -k /--key, -v/--value, -t/--template

Similar to write, but appends values rather than replacing them.

read

Arguments: -k /--key, -t/--template

Print a value from within a template to the console. For example, with the template data:

{
    "test": [1, 2, 3]
}

layer read -k test[0] prints 1 to the console.

remove

Arguments: -k /--key, -t/--template

Delete the value of a key within a template's data. If the key is an index into an array, the array is reduced in size.

list

List the names of all saved templates.

show

Arguments: -t/--template

Print a template and its data to the console.

delete

Arguments: -t/--template

Deletes a reference to a named Jade template and JSON data file. This does not remove the files themselves.

config

Arguments: The same as render

Shows the stored default settings for layer, or updates them if a setting name and value are passed.

completion

Prints a bash completion script to enable tab completion of layer commands and options. Append this to ~/.bashrc when layer is installed so that completions are automatically available.

License

MIT