Public vals
167
tmcw
nanoidExample
Script
nanoid nanoid is like a shorter, more fashionable alternative to UUIDs. Versus UUIDs: They're shorter, with a more customizable alphabet. They use more different characters by default. Unlike UUIDs, there aren't custom types for nanoids in databases Nanoids never contain information. UUIDs sometimes do: some UUIDs contain timestamps and MAC addresses.
0
tmcw
markedExample
Script
marked marked is a classic Markdown parser in JavaScript. I really don't like it! I don't recommend it! The people who made it and worked on it are great, but I think you really shouldn't use it. It supports a non-standard variation of Markdown, so you can't easily switch to another parser once you've encouraged people to write "in the marked style" It allows but doesn't sanitize HTML, which promotes a lot of XSS attacks It doesn't use an intermediate AST like remark or support plugins. Really it's a much better idea to use micromark or remark .
0
tmcw
semverExample
Script
semver The semver module is the most popular way to parse the Semantic Versioning style of versions. Semantic Versions attempt to convey a lot more information about a version than just a single number - each part of the version indicates breaking changes, features, or minor updates.
0
tmcw
jsYAMLExample
Script
js-yaml YAML is a popular format for data which is an alternative to JSON . In contrast to JSON, YAML can look more user-friendly: you can write text without worrying about quoting strings You can write comments in YAML But, on the other side, it's more possible to write YAML that is parsed in an unexpected way. JSON is more explicit and predictable. js-yaml is the most popular YAML parser for JavaScript.
0
tmcw
cheerioExample
Script
cheerio cheerio is a popular npm module that makes it easy to parse and manipulate HTML and XML. cheerio is modeled after a reduced version of jQuery . Note that it's pretty different than default browser DOM methods, so you can't call things like .appendChild or document.createElement when using cheerio: it's not based on a full-fledged DOM or browser implementation. But, in exchange it's a lot faster and simpler.
0
tmcw
uuidExample
Script
uuid The uuid module provides builders for different types of universally unique identifiers . These are kinds of identifiers that you can use instead of auto-incrementing integers. They're intended to contain so much randomness that the chances of a collision between two uuids is very low. There are different versions of uuids available: typically people use v4 UUIDs, which are fully random.
0
tmcw
underscoreExample
Script
underscore underscore is a module for functional programming and other utilities in JavaScript. It inspired lodash , which is what most people use now, because lodash is both faster, and provides an ESM version which is convenient to use in Val Town. Note that while we can import from lodash-es and use its named exports, underscore only provides a default export, so that's why we have the code { default: _ } below.
0