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

ttouch

v2.1.0

Published

Create files easily

Downloads

11

Readme

Build Status npm Gitter

NPM

ttouch

touch with templates

Creating new files is easy, but entering the same boilerplate content into everyone is tedious. When creating a new my_script.sh file would it not be great if the shebang would already be there?

That is what ttouch does for you and much more.

Installation

$ npm install -g ttouch

What if I do not want to install it

If you do not want to pollute your global namespace then ttouch can be use npx. But more on that in the usage section.

Usage

$ ttouch <filePath> [options]

or if you do not want to install it globally

$ npx ttouch <filePath> [options]

Options

| Short | Long | Description | | --- | --- | --- | | -d | --destination | The destination folder for the desired file(s) | | -g | --gist | The public gist ID to use as the template | | -f | --file | The local file used as the template | | -v | --verbose | Provides additional error information. Does not add additional output statements under normal operation! |

Environment variables

ttouch uses the TTOUCH_HOME environment variable to determine the default location for file templates. If this environment variable is present then the absolute path to the provided template file will be assumed to the ````$TTTOUCH_HOME/{templateName}```.

Example:

$ ttouch user.js -f js_class

Given that TTOUCH_HOME = /var/ttouch

Then the template used will be assumed to be at /var/ttouch/js_template

Examples

$ ttouch test.sh

Will create an empty file names test.sh in the current directory.

$ ttouch test.sh -g 37bcbb7217d26c2dd3e5f4cee9fd6e37

Will create a test.sh file in the current directory using the public gist 37bcbb7217d26c2dd3e5f4cee9fd6e37

$ ttouch test.sh -f bash

Will create a test.sh file using a file named bash located in the current folder or specified by TTOUCH_HOME.

/home/me $ ttouch /dir1/dir2/test.sh -f bash

Will create a file named test.sh in the directory /home/me/dir1/dir2/test.sh and apply the ttt-bash template to the created file.

NOTE: If and part of the destination path does not exist then the directories will be created

The same could be achieved with:

/home/me $ ttouch test.sh -f bash -d dir1/dir2

Multiple files

Want to create more than just one file? No problem. Just list them and provide an optional template.

$ ttouch student.js teacher.js -t jsclass

Will create two files student.js and teacher.js in the current folder applying the ttt-jsclass template to both!

Templates

ttouch does not come with any templates out of the box. All templates are external to the program, files and gists. So one of the first tasks will be to start a template or two.

Next steps

Try it

Give the thing a try to see if you like it or if there is something missing

Get in touch

If you have any feedback do not hesitate to utter it. Use any of the following channels to do so:

Create a template

There is a list of my template -> HERE

If you would like to create your own -> HERE