Results for “require”
Small, practical examples. Search by task or narrow things down below.
Read an annotated tag’s message
Git: for-each-ref can inspect annotation contents without including a commit diff.
Git✓ Tested
Read an image’s default command
Docker / Compose: Config.Cmd contains the command arguments stored in the image.
Docker / Compose✓ Tested
Read an ISO-style weekday number
TypeScript: Convert Sunday from zero to seven when using Monday-through-Sunday numbering.
TypeScript✓ Tested
Read an object’s own enumerable values
TypeScript: Object.values provides values without their corresponding keys.
TypeScript✓ Tested
Read an optional associative-array entry
Bash Scripts: Use a fallback expansion when a map key may not be present under nounset.
Bash Scripts✓ Tested
Read commit subjects affecting one file
Git: Place the path after -- so Git limits history to the selected file.
Git✓ Tested
Read commit subjects from oldest to newest
Git: Reverse the normal newest-first history order.
Git✓ Tested
Read complete lines into an array
Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.
Bash Scripts✓ Tested
Read CSV rows as dictionaries
Read a CSV file using its header row as dictionary keys, so each column can be accessed by name.
csv✓ Tested
Read date components in UTC
TypeScript: UTC accessors avoid differences caused by the machine’s local timezone.
TypeScript✓ Tested
Read fields captured by a Bash regular expression
Bash Scripts: BASH_REMATCH contains the full match followed by capture groups after a successful regex test.
Bash Scripts✓ Tested
Read from a dedicated file descriptor
Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.
Bash Scripts✓ Tested