Repository: xtyrrell/undollar
Branch: master
Commit: 27e5f0f87ddc
Files: 6
Total size: 5.1 KB
Directory structure:
gitextract_gsasgdsc/
├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── package.json
└── undollar.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Compiled C output
*.out
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
================================================
FILE: .npmignore
================================================
*.c
*.out
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2017 Max
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.
================================================
FILE: README.md
================================================
# undollar
undollar strips the dollar sign from the beginning of the terminal command you just copied from StackOverflow when you were searching for what arguments to pass to `tar` (`xzf`? `xvfJ`? Or was it `xvf`? You never seem to remember).
## Installation
Simply install undollar as a global package using npm or yarn:
```
$ npm install -g undollar
```
well, because you haven't installed it yet,
```
npm install -g undollar
```
## Usage
After you've installed undollar, you can forget it exists. Next time you paste in a command prefixed with a dollar sign, undollar will quietly eat the dollar sign and run the rest of the command.
```
neo@computey:~$ $ tar xvfJ something.tar.xz
neo@computey:~$
neo@computey:~$ echo "It worked! Thanks undollar!"
```
It's as if that stray dollar sign was never there in the first place!
## Wait what
People often put a "$" in front of a command to indicate that it must be executed on the command line. This is because, on Unix-like operating systems, the command-prompt usually ends in a "$" for non-root users -- so the last thing before a command is a "$".
Often when copy-pasting terminal commands from the internet you'll inadvertently end up also having copied the dollar sign at the beginning (especially if you triple-click to select). Trying to execute the command you just pasted will result in some variant of "command not found" or "No such file or directory".
Installing undollar solves this problem, by registering `$` as a valid command, which simply runs everything after that `$`.
================================================
FILE: package.json
================================================
{
"name": "undollar",
"version": "1.0.0",
"description": "undollar strips the dollar sign from the beginning of the terminal command you just copied from StackOverflow when you were searching for what arguments to pass to `tar` (`xzf`? `xvfJ`? Or was it `xvf`? You never seem to remember).",
"preferGlobal": true,
"bin": {
"$": "./undollar.js"
},
"main": "undollar.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ImFeelingDucky/undollar.git"
},
"keywords": [
"command-line",
"convenience",
"copy-paste",
"dollar"
],
"author": "Max Tyrrell",
"license": "MIT",
"bugs": {
"url": "https://github.com/ImFeelingDucky/undollar/issues"
},
"homepage": "https://github.com/ImFeelingDucky/undollar#readme",
"dependencies": {}
}
================================================
FILE: undollar.js
================================================
#!/usr/bin/env node
const { spawn } = require('child_process')
if (!process.argv[2]) {
console.log('Usage: $ command [args] where command is any valid terminal command.')
process.exit()
}
// Run a command with its arguments by spawning a process and
// transparently routing stdio and signals through this parent process
const spawnedProcess = spawn(
process.argv[2],
process.argv.slice(3),
{stdio: 'inherit'}
);
// Route signals through so they still reach the spawned process
process.on('SIGTERM', () => spawnedProcess.kill('SIGTERM'))
process.on('SIGINT', () => spawnedProcess.kill('SIGINT'))
process.on('SIGBREAK', () => spawnedProcess.kill('SIGBREAK'))
process.on('SIGHUP', () => spawnedProcess.kill('SIGHUP'))
// Exit this process when the spawned process exits
spawnedProcess.on('exit', process.exit)
gitextract_gsasgdsc/ ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── package.json └── undollar.js
Condensed preview — 6 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6K chars).
[
{
"path": ".gitignore",
"chars": 911,
"preview": "# Compiled C output\n*.out\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*"
},
{
"path": ".npmignore",
"chars": 10,
"preview": "*.c\n*.out\n"
},
{
"path": "LICENSE",
"chars": 1060,
"preview": "MIT License\n\nCopyright (c) 2017 Max\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof thi"
},
{
"path": "README.md",
"chars": 1543,
"preview": "# undollar\nundollar strips the dollar sign from the beginning of the terminal command you just copied from StackOverflow"
},
{
"path": "package.json",
"chars": 880,
"preview": "{\n \"name\": \"undollar\",\n \"version\": \"1.0.0\",\n \"description\": \"undollar strips the dollar sign from the beginning of th"
},
{
"path": "undollar.js",
"chars": 833,
"preview": "#!/usr/bin/env node\n\nconst { spawn } = require('child_process')\n\nif (!process.argv[2]) {\n console.log('Usage: $ comma"
}
]
About this extraction
This page contains the full source code of the xtyrrell/undollar GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 6 files (5.1 KB), approximately 1.4k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.