Skip to main content

Activity for haltcase.dev

Active on:

Loading activity...

Back to the newest activity

Posted: > 8 year old npm package > published 10 months ago > 1000s of weekly downloads > still version 0.7.0 😶Bluesky network
Posted: yield* I just wanted to get in on the clever JS lingo repliesBluesky network
PostedBluesky network

Integrated @arktype.io into my haltcase.dev/run script runner. Silly example, but it makes writing handy reusable scripts type-safe _and_ delightful 😁

  • TypeScript code using the `@haltcase/run` and `arktype` libraries:

import { task } from "@haltcase/run";
import { type } from "arktype";

const schema = type({
	name: "string",
	class: "'Barbarian' | 'Rogue' | 'Wizard' = 'Rogue'",
	armorClass: "string.numeric.parse",
	env: {
		"SECRET_GMS_WEAKNESS?": "string"
	}
});

export const printCharacter = task.strict(
	schema,
	async ({ env, name, armorClass, class: characterClass }) => {
		console.log([
			`🎲 ${name}`,
			`⚔️ ${characterClass}`,
			`🛡️ ${armorClass}`
		].join("\n"));

		if (env.SECRET_GMS_WEAKNESS) {
			console.log(`${env.SECRET_GMS_WEAKNESS} makes ${name} king!`);
		}
	}
);
  • Result of using `@haltcase/run` with the other image's code via CLI commands:

$ hr example printCharacter --name Gorf --armorClass 12 --class Barbarian
🎲 Gorf
⚔️ Barbarian
🛡️ 12

$ hr example printCharacter --name Dimble --armorClass 14
🎲 Dimble
⚔️ Rogue
🛡️ 14

$ SECRET_GMS_WEAKNESS=scotch hr example printCharacter --name Harboyger --armorClass 11 --class Wizard
🎲 Harboyger
⚔️ Wizard
🛡️ 11
scotch makes Harboyger king!
Posted: Guess not at the nature of the behemoth, for it is wilder than we can fathom. Sorry Adam 🙏Bluesky network
Posted: npm breaking everyone's tokens 💀 npm is like the patron saint of maintenance mode at this pointBluesky network
Posted: My kingdom, your kingdom, everyone's kingdom for enum+ADT+pattern matching in JS. That'd be the life. Please. Do it.Bluesky network
Posted: The best JavaScript is #FreeJavaScript ✊Bluesky network
Posted: I never liked Triscuits as a kid, so it feels like a sign I went and got old now that I think they're super tasty and can't stop eating themBluesky network
Posted: Cool news about @typescriptlang.org Go port! Good on them choosing Go based on the criteria of the project and team... but I still can't br…Bluesky network
Posted: When the last bite of something was the best one 👌 German has to have a word for that right?Bluesky network
Posted: Am I the only one who went "uhhhh" to the dude laying on the street light in Kendrick's show given a recent Phili event?Bluesky network
Posted: It has already begunBluesky network
Posted: 2 months with a newborn, and I'm hearing shushing even in complete silence, like the white noise has imprinted permanently on my brainBluesky network
Posted: Stable `eslint.config.ts`, aww yissBluesky network
Posted: If bakers bake, do fathers fath? 🤔Bluesky network
Posted: Prod is the final frontierBluesky network
Posted: Damn, I might like @svelte.dev after allBluesky network
Posted: Mozilla's new branding is a monstrosity. To be clear, yuckBluesky network
Posted: GitHub going down at the exact moment you're trying to merge a PR = 😭Bluesky network