Socket
Socket
Sign inDemoInstall

hr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hr - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

README.md.old

14

lib/hr.js

@@ -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
$
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc