import { quote } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/workerd/cli.js";
Quotes a string to be used as a single argument to a shell command.
Examples
Example 1
Example 1
import { quote } from "@ayonli/jsext/cli";
console.log(quote("Hello, World!")); // "Hello, World!"
console.log(quote("Hello, 'World'!")); // "Hello, 'World'!"
console.log(quote("Hello, \"World\"!")); // "Hello, \"World\"!"
console.log(quote("Hello, $World!")); // "Hello, \$World!"
console.log(quote("Hello, `World`!")); // "Hello, \`World\`!"
console.log(quote("Hello, \\World!")); // "Hello, \\World!"