Copy the two bash functions in this gist into .bashrc (or wherever appropriate for your startup files).
bash-5.1$ npm-release-notes -h
Usage: npm-release-notes [OPTIONS] PACKAGE [VERSION]| /* @see: https://thecascade.dev/article/least-amount-of-css/ */ | |
| html { | |
| color-scheme: light dark; | |
| } | |
| body { | |
| font-family: system-ui; | |
| font-size: 1.25rem; | |
| line-height: 1.5; | |
| } |
| #!/usr/bin/env node | |
| import fs from "fs"; | |
| import path from "path"; | |
| import { fileURLToPath } from "url"; | |
| const __filename = fileURLToPath(import.meta.url); | |
| const __dirname = path.dirname(__filename); | |
| function isNodeModulesImport(importPath) { |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <progress id='imageProgress' value='0' max='100'></progress> |
| // more minimal version of https://github.com/olahol/scrollparent.js/blob/master/scrollparent.js | |
| const regex = /(auto|scroll)/; | |
| const style = (node, prop) => | |
| getComputedStyle(node, null).getPropertyValue(prop); | |
| const scroll = (node) => | |
| regex.test( | |
| style(node, "overflow") + | |
| style(node, "overflow-y") + |
| // Credits: https://medium.com/@saeed.asghari.241/create-custom-event-in-typescript-8219054cee5d | |
| class EventBus extends EventTarget { | |
| constructor() { | |
| super() | |
| } | |
| addCustomEventListener<T extends Partial<Record<string, any>>>( | |
| type: string, | |
| listener: (event: CustomEvent<T>) => void, |
If you're OK in having a node-esm executable, please consider this solution.
#!/usr/bin/env sh
# the /usr/local/bin/node-esm executable
input_file=$1
shift
exec node --input-type=module - $@ <$input_file| # The command finds the most recent tag that is reachable from a commit. | |
| # If the tag points to the commit, then only the tag is shown. | |
| # Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
| # and the abbreviated object name of the most recent commit. | |
| git describe | |
| # With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
| git describe --abbrev=0 | |
| # Other examples |
| foo | |
| bar | |
| baz |
| #!/usr/bin/env bash | |
| # | |
| # Authors: | |
| # Stefan Buck (https://github.com/stefanbuck) | |
| # Thomas Ruoff (https://github.com/tomru) | |
| # | |
| # | |
| # Description: | |
| # Are you still prefixing your commits with a ticket number manually? You will love this script! | |
| # This is a git hook script that will automatically prefix your commit messages with a ticket |