pax_global_header00006660000000000000000000000064141107732150014513gustar00rootroot0000000000000052 comment=b9c449568992c954bd71de0ab44904544757545e restore-cursor-4.0.0/000077500000000000000000000000001411077321500145125ustar00rootroot00000000000000restore-cursor-4.0.0/.editorconfig000066400000000000000000000002571411077321500171730ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 restore-cursor-4.0.0/.gitattributes000066400000000000000000000000231411077321500174000ustar00rootroot00000000000000* text=auto eol=lf restore-cursor-4.0.0/.github/000077500000000000000000000000001411077321500160525ustar00rootroot00000000000000restore-cursor-4.0.0/.github/funding.yml000066400000000000000000000001701411077321500202250ustar00rootroot00000000000000github: sindresorhus open_collective: sindresorhus tidelift: npm/restore-cursor custom: https://sindresorhus.com/donate restore-cursor-4.0.0/.github/security.md000066400000000000000000000002631411077321500202440ustar00rootroot00000000000000# Security Policy To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. restore-cursor-4.0.0/.github/workflows/000077500000000000000000000000001411077321500201075ustar00rootroot00000000000000restore-cursor-4.0.0/.github/workflows/main.yml000066400000000000000000000006261411077321500215620ustar00rootroot00000000000000name: CI on: - push - pull_request jobs: test: name: Node.js ${{ matrix.node-version }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: node-version: - 16 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test restore-cursor-4.0.0/.gitignore000066400000000000000000000000271411077321500165010ustar00rootroot00000000000000node_modules yarn.lock restore-cursor-4.0.0/.npmrc000066400000000000000000000000231411077321500156250ustar00rootroot00000000000000package-lock=false restore-cursor-4.0.0/index.d.ts000066400000000000000000000002611411077321500164120ustar00rootroot00000000000000/** Gracefully restore the CLI cursor on exit. @example ``` import restoreCursor from 'restore-cursor'; restoreCursor(); ``` */ export default function restoreCursor(): void; restore-cursor-4.0.0/index.js000066400000000000000000000004071411077321500161600ustar00rootroot00000000000000import process from 'node:process'; import onetime from 'onetime'; import signalExit from 'signal-exit'; const restoreCursor = onetime(() => { signalExit(() => { process.stderr.write('\u001B[?25h'); }, {alwaysLast: true}); }); export default restoreCursor; restore-cursor-4.0.0/index.test-d.ts000066400000000000000000000000721411077321500173670ustar00rootroot00000000000000import restoreCursor from './index.js'; restoreCursor(); restore-cursor-4.0.0/license000066400000000000000000000021351411077321500160600ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (https://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: 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. restore-cursor-4.0.0/package.json000066400000000000000000000016451411077321500170060ustar00rootroot00000000000000{ "name": "restore-cursor", "version": "4.0.0", "description": "Gracefully restore the CLI cursor on exit", "license": "MIT", "repository": "sindresorhus/restore-cursor", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "type": "module", "exports": "./index.js", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "scripts": { "test": "xo && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "exit", "quit", "process", "graceful", "shutdown", "sigterm", "sigint", "terminate", "kill", "stop", "cli", "cursor", "ansi", "show", "term", "terminal", "console", "tty", "shell", "command-line" ], "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "devDependencies": { "tsd": "^0.7.2", "xo": "^0.24.0" } } restore-cursor-4.0.0/readme.md000066400000000000000000000013371411077321500162750ustar00rootroot00000000000000# restore-cursor > Gracefully restore the CLI cursor on exit Prevent the cursor you've hidden interactively from remaining hidden if the process crashes. ## Install ``` $ npm install restore-cursor ``` ## Usage ```js import restoreCursor from 'restore-cursor'; restoreCursor(); ``` ---
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.