Comparing version 0.1.2 to 0.1.3
@@ -1,9 +0,11 @@ | ||
// TODO: test this with '*' | ||
// TODO: better support for multi-character strings (i.e. use a partial word at the end) | ||
function hr(str) { | ||
function hr(inputHrStr) { | ||
width = (process.stdout.isTTY) ? process.stdout.getWindowSize()[0] : 0; | ||
hrChar = str.length > 0 ? str : "="; | ||
console.log(Array(Math.floor(width/hrChar.length) + 1).join(hrChar)); | ||
hrStr = inputHrStr.length > 0 ? inputHrStr : "="; | ||
var out = (Array(Math.floor(width/hrStr.length) + 1).join(hrStr)); | ||
var partialLen = (width - (Math.floor(width/hrStr.length)) * hrStr.length); // determine length of partial hrStr to finish the line | ||
out += hrStr.substring(0, partialLen); | ||
console.log(out); | ||
} | ||
exports.hr = hr; | ||
exports.hr = hr; |
@@ -5,3 +5,3 @@ { | ||
"description": "Node commandline application to display <hr> in the console.", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "http://www.github.com/jaredsohn/hr" |
Displays an `<hr />` in your terminal. | ||
A version of https://github.com/LuRsT/hr that can be deployed via npm. | ||
Installation instructions: | ||
npm install -g hr | ||
## Usage: | ||
$ hr | ||
================================== # Till the end of your terminal window | ||
$ | ||
$ hr '*' | ||
********************************** # Till the end of your terminal window | ||
$ | ||
It works differently than the shell app for multi-character strings | ||
$ hr =- | ||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Till the end of your terminal window | ||
$ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2118
5
9
24