Module

x/semver/cli.ts

The semver parser for Deno (a fork of node-semver using TypeScript)
Extremely Popular
Latest
File
import * as semver from "./mod.ts";
const [command, ...args] = Deno.args;
const output = async (content: string) => await Deno.stdout.write(new TextEncoder().encode(content?.toString() + "\n"));
const callFunction = async (command: string, args: string[]) => //@ts-ignore await output(semver[command](...args));
switch (command) { case "valid": case "clean": case "satisfies": case "gt": case "lt": case "minVersion": await callFunction(command, args); break; default: await output(`valid 1.2.3 // "1.2.3"valid a.b.c // nullclean " =v1.2.3 " // "1.2.3"satisfies "1.2.3" "1.x || >=2.5.0 || 5.0.0 - 7.2.3" // truegt "1.2.3" "9.8.7" // falselt "1.2.3" "9.8.7" // trueminVersion ">=1.0.0" // "1.0.0"`);}
Deno.exit();