From 7b2f196a812680c1686e2300997854289b96dbd5 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 21 Feb 2018 23:38:11 +0700 Subject: [PATCH] Meta tweaks --- .editorconfig | 2 +- .gitignore | 1 + .npmrc | 1 + index.js | 2 +- license | 20 +++-------- package.json | 96 +++++++++++++++++++++++++-------------------------- readme.md | 11 ++++-- 7 files changed, 64 insertions(+), 69 deletions(-) create mode 100644 .npmrc diff --git a/.editorconfig b/.editorconfig index 98a761d..1c6314a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[{package.json,*.yml}] +[*.yml] indent_style = space indent_size = 2 diff --git a/.gitignore b/.gitignore index 3c3629e..239ecff 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +yarn.lock diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/index.js b/index.js index 162e695..49bef78 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,7 @@ class Ora { this.frameIndex = 0; this.enabled = typeof this.options.enabled === 'boolean' ? this.options.enabled : ((this.stream && this.stream.isTTY) && !process.env.CI); - // Set *after* this.stream + // Set *after* `this.stream` this.text = this.options.text; this.linesToClear = 0; } diff --git a/license b/license index 654d0bf..e7af2f7 100644 --- a/license +++ b/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/package.json b/package.json index 21bf2bc..d394aa2 100644 --- a/package.json +++ b/package.json @@ -1,50 +1,50 @@ { - "name": "ora", - "version": "1.4.0", - "description": "Elegant terminal spinner", - "license": "MIT", - "repository": "sindresorhus/ora", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "cli", - "spinner", - "spinners", - "terminal", - "term", - "console", - "ascii", - "unicode", - "loading", - "indicator", - "progress", - "busy", - "wait", - "idle" - ], - "dependencies": { - "chalk": "^2.1.0", - "cli-cursor": "^2.1.0", - "cli-spinners": "^1.0.1", - "log-symbols": "^2.1.0", - "strip-ansi": "^4.0.0", - "wcwidth": "^1.0.1" - }, - "devDependencies": { - "ava": "*", - "get-stream": "^3.0.0", - "xo": "*" - } + "name": "ora", + "version": "1.4.0", + "description": "Elegant terminal spinner", + "license": "MIT", + "repository": "sindresorhus/ora", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "cli", + "spinner", + "spinners", + "terminal", + "term", + "console", + "ascii", + "unicode", + "loading", + "indicator", + "progress", + "busy", + "wait", + "idle" + ], + "dependencies": { + "chalk": "^2.3.1", + "cli-cursor": "^2.1.0", + "cli-spinners": "^1.1.0", + "log-symbols": "^2.2.0", + "strip-ansi": "^4.0.0", + "wcwidth": "^1.0.1" + }, + "devDependencies": { + "ava": "*", + "get-stream": "^3.0.0", + "xo": "*" + } } diff --git a/readme.md b/readme.md index 726d59d..40cba0e 100644 --- a/readme.md +++ b/readme.md @@ -10,10 +10,12 @@ ## Install ``` -$ npm install --save ora +$ npm install ora ``` -*Show your support for Ora by buying this excellent [Node.js course](https://LearnNode.com/friend/AWESOME).* + + + ## Usage @@ -32,7 +34,7 @@ setTimeout(() => { ## API -It will gracefully not do anything when there's no TTY or when in a CI. +It will gracefully not do anything when there's no TTY or when running in a CI. ### ora([options|text]) @@ -74,6 +76,9 @@ Color of the spinner. ##### hideCursor +Type: `boolean`
+Default: `true` + Set to `false` to stop Ora from hiding the cursor. ##### interval