### Running Express.js examples (Console) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/express/Readme.md After cloning the Express.js repository and installing dependencies, this command allows you to run specific examples provided within the repository. Replace 'content-negotiation' with the name of the example you wish to execute. ```bash $ node examples/content-negotiation ``` -------------------------------- ### Basic Express.js Server Setup (JavaScript) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/express/Readme.md This snippet demonstrates the fundamental setup of an Express.js server in Node.js. It initializes an Express application, defines a route for the root URL ('/'), and starts the server listening on port 3000. This is a common starting point for building web applications with Express. ```javascript const express = require('express') const app = express() app.get('/', function (req, res) { res.send('Hello World') }) app.listen(3000) ``` -------------------------------- ### Usage Example for side-channel-list Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/side-channel-list/README.md This JavaScript example demonstrates how to use the side-channel-list package. It shows how to initialize a channel, set, get, assert, and delete keys, along with assertions to verify the expected behavior. ```js const assert = require('assert'); const getSideChannelList = require('side-channel-list'); const channel = getSideChannelList(); const key = {}; assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); channel.set(key, 42); channel.assert(key); // does not throw assert.equal(channel.has(key), true); assert.equal(channel.get(key), 42); channel.delete(key); assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); ``` -------------------------------- ### Install get-proto using npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/get-proto/README.md This command installs the 'get-proto' library as a project dependency using npm. It is a prerequisite for using the library in your Node.js or browser projects. ```shell npm install --save get-proto ``` -------------------------------- ### Install and Run Tests Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/send/README.md This snippet shows the standard npm commands for installing project dependencies and running the test suite. Ensure you have Node.js and npm installed. ```bash $ npm install $ npm test ``` -------------------------------- ### Usage Example for side-channel-weakmap Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/side-channel-weakmap/README.md Demonstrates how to use the side-channel-weakmap package to set, get, assert, and delete values associated with keys. It utilizes Node.js's assert module for verification. ```javascript const assert = require('assert'); const getSideChannelList = require('side-channel-weakmap'); const channel = getSideChannelList(); const key = {}; assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); channel.set(key, 42); channel.assert(key); // does not throw assert.equal(channel.has(key), true); assert.equal(channel.get(key), 42); channel.delete(key); assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); ``` -------------------------------- ### Starting the Express development server (Console) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/express/Readme.md This command starts the Express development server, typically defined in the 'scripts' section of your package.json file (often as 'npm start'). It makes your application accessible, usually at http://localhost:3000. ```bash $ npm start ``` -------------------------------- ### Install serve-static with npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/serve-static/README.md This command installs the serve-static Node.js module using npm. It is a prerequisite for using the module in a Node.js project. ```sh npm install serve-static ``` -------------------------------- ### Install call-bind-apply-helpers Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/call-bind-apply-helpers/README.md Installs the 'call-bind-apply-helpers' package using npm. This is the first step to using the helper functions in your project. ```sh npm install --save call-bind-apply-helpers ``` -------------------------------- ### Install media-typer Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/media-typer/README.md Installs the media-typer package using npm. This is the first step to using the library in your Node.js project. ```shell npm install media-typer ``` -------------------------------- ### Installing Express.js using npm (Console) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/express/Readme.md This command installs the Express.js framework locally for a Node.js project using npm. It assumes you have Node.js and npm installed and have initialized your project with 'npm init'. This is the standard way to add Express as a dependency. ```bash $ npm install express ``` -------------------------------- ### Install Node Touch Package Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/touch/README.md Installs the node-touch package using npm. This is the first step to using the package in your project. ```bash npm install touch ``` -------------------------------- ### Install depd using npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/depd/Readme.md This command installs the 'depd' module using npm. It's a standard Node.js package installation. ```sh npm install depd ``` -------------------------------- ### Install ee-first using npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/ee-first/README.md This snippet shows the command to install the ee-first package using npm. It's a prerequisite for using the library in a Node.js project. ```sh npm install ee-first ``` -------------------------------- ### Install accepts Package Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/accepts/README.md Installs the 'accepts' Node.js module using npm. This is the first step to integrate content negotiation into your project. ```sh npm install accepts ``` -------------------------------- ### Install content-disposition package Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/content-disposition/README.md Installs the content-disposition package using npm. This is the first step to using the library in a Node.js project. ```sh npm install content-disposition ``` -------------------------------- ### Install nodemon Globally Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/nodemon/README.md Installs nodemon globally on your system, making it available in your system path for direct command-line use. This is the recommended method for general use. ```bash npm install -g nodemon # or using yarn: yarn global add nodemon ``` -------------------------------- ### Install methods package Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/methods/README.md This command installs the 'methods' package using npm. It is a prerequisite for using the module in your Node.js project. ```bash npm install methods ``` -------------------------------- ### Install utils-merge using npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/utils-merge/README.md This command installs the utils-merge package from npm, making it available for use in your project. It is a prerequisite for using the merge functionality. ```bash npm install utils-merge ``` -------------------------------- ### Install body-parser Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/body-parser/README.md Installs the body-parser package using npm. This is the first step to integrate the middleware into a Node.js project. ```sh $ npm install body-parser ``` -------------------------------- ### Install to-regex-range with npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/to-regex-range/README.md Installs the to-regex-range package using npm. This is the first step to using the library in your Node.js project. ```sh npm install --save to-regex-range ``` -------------------------------- ### Install proxy-addr using npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/proxy-addr/README.md This snippet shows how to install the proxy-addr module using npm, a package manager for Node.js. This is a prerequisite for using the module in your project. ```sh npm install proxy-addr ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/fill-range/README.md This code snippet demonstrates the command to install project dependencies and run the associated unit tests. It's a standard procedure for verifying the functionality and stability of the library. ```sh $ npm install && npm test ``` -------------------------------- ### Get Raw Body in Koa.js Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/raw-body/README.md An example of using 'raw-body' with Koa.js, utilizing generator functions and promises. It parses the request body with similar options to the Express example, making the result available as 'this.text'. ```javascript var contentType = require('content-type') var getRawBody = require('raw-body') var koa = require('koa') var app = koa() app.use(function * (next) { this.text = yield getRawBody(this.req, { length: this.req.headers['content-length'], limit: '1mb', encoding: contentType.parse(this.req).parameters.charset }) yield next }) ``` -------------------------------- ### Installing Express Generator globally (Console) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/express/Readme.md This command installs the Express Generator tool globally, allowing you to quickly scaffold new Express applications. The '@4' ensures you install version 4.x, which is compatible with Express 4.x. This tool simplifies project setup. ```bash $ npm install -g express-generator@4 ``` -------------------------------- ### Run Tests and Build Documentation (Shell) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/picomatch/README.md Provides shell commands for setting up project dependencies and running tests. It also includes instructions for generating project documentation using the 'verb' tool, emphasizing that direct edits to the README are discouraged. ```shell npm install && npm test ``` ```shell npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Install raw-body Node.js Module Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/raw-body/README.md Installs the 'raw-body' Node.js module using npm. This is the standard command for adding the package to your project's dependencies. ```sh npm install raw-body ``` -------------------------------- ### Install Node.js Types for TypeScript Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/raw-body/README.md Installs the necessary TypeScript declaration files for Node.js, which are a dependency for using 'raw-body' in a TypeScript project. This enables type checking and autocompletion. ```sh npm install @types/node ``` -------------------------------- ### Use ee-first to listen for the first event Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/ee-first/README.md This example illustrates the primary usage of ee-first. It sets up listeners on multiple event emitters and defines a callback function that executes upon the first emitted event. The callback receives details about the event and the emitter that triggered it. ```javascript var ee1 = new EventEmitter() var ee2 = new EventEmitter() first([ [ee1, 'close', 'end', 'error'], [ee2, 'error'] ], function (err, ee, event, args) { // listener invoked }) ``` -------------------------------- ### Get Raw Body with TypeScript (TypeScript) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/raw-body/README.md This example demonstrates using the 'raw-body' library with TypeScript to get the raw HTTP request body. It leverages promises for handling the asynchronous operation and requires the 'raw-body' and 'http' modules. The code handles both successful retrieval and potential errors. ```typescript import * as getRawBody from 'raw-body'; import * as http from 'http'; const server = http.createServer((req, res) => { getRawBody(req) .then((buf) => { res.statusCode = 200; res.end(buf.length + ' bytes submitted'); }) .catch((err) => { res.statusCode = err.statusCode; res.end(err.message); }); }); server.listen(3000); ``` -------------------------------- ### Get Raw Body in Express.js Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/raw-body/README.md An example of using 'raw-body' within an Express.js middleware to parse the request body. It sets options for content length, a 1MB limit, and decodes the body using the charset from the Content-Type header. ```javascript var contentType = require('content-type') var express = require('express') var getRawBody = require('raw-body') var app = express() app.use(function (req, res, next) { getRawBody(req, { length: req.headers['content-length'], limit: '1mb', encoding: contentType.parse(req).parameters.charset }, function (err, string) { if (err) return next(err) req.text = string next() }) }) ``` -------------------------------- ### Serving Static Files from Multiple Roots with Express Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/serve-static/README.md This example demonstrates how to configure Express to serve static files from multiple directories. Files are first searched in 'public-optimized/', and if not found, they are then searched in 'public/'. This is useful for fallbacks or prioritizing certain file versions. Dependencies include 'express', 'path', and 'serve-static'. ```javascript var express = require('express') var path = require('path') var serveStatic = require('serve-static') var app = express() app.use(serveStatic(path.join(__dirname, 'public-optimized'))) app.use(serveStatic(path.join(__dirname, 'public'))) app.listen(3000) ``` -------------------------------- ### readdirp Promise API Example Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/readdirp/README.md Shows how to use the promise-based API of readdirp to asynchronously get a list of file entries. This method might consume more memory compared to the stream API. ```javascript const readdirp = require('readdirp'); // 3) Promise example. More RAM and CPU than streams / for-await. const files = await readdirp.promise('.'); console.log(files.map(file => file.path)); ``` -------------------------------- ### Usage Example: side-channel package in JavaScript Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/side-channel/README.md Demonstrates how to use the 'side-channel' package to set, get, assert, and delete values associated with a key. It includes assertions to verify the state of the channel. ```javascript const assert = require('assert'); const getSideChannel = require('side-channel'); const channel = getSideChannel(); const key = {}; assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); channel.set(key, 42); channel.assert(key); // does not throw assert.equal(channel.has(key), true); assert.equal(channel.get(key), 42); channel.delete(key); assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); ``` -------------------------------- ### semver command-line utility usage Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/semver/README.md Illustrates the command-line interface for the semver utility. It shows how to get help and provides an overview of available options for version comparison, incrementing, and range matching. ```bash $ semver -h A JavaScript implementation of the https://semver.org/ specification Copyright Isaac Z. Schlueter Usage: semver [options] [ [...]] Prints valid versions sorted by SemVer precedence Options: -r --range Print versions that match the specified range. -i --increment [] Increment a version by the specified level. Level can be one of: major, minor, patch, premajor, preminor, prepatch, prerelease, or release. Default level is 'patch'. Only one version may be specified. --preid Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -l --loose Interpret versions and ranges loosely -n <0|1|false> Base number for prerelease identifier (default: 0). Use false to omit the number altogether. -p --include-prerelease Always include prerelease versions in range matching -c --coerce Coerce a string into SemVer if possible (does not imply --loose) --rtl Coerce version strings right to left --ltr Coerce version strings left to right (default) Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. ``` -------------------------------- ### Get and Cache JavaScript Intrinsics with get-intrinsic Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/get-intrinsic/README.md This example demonstrates how to use the 'get-intrinsic' library to retrieve and use JavaScript's built-in intrinsics. It shows how to access static methods like Math.pow and instance methods like Array.prototype.push, and verifies their functionality even after they have been deleted from their original global locations. It also illustrates how to handle cases where an intrinsic might be missing. ```javascript var GetIntrinsic = require('get-intrinsic'); var assert = require('assert'); // static methods assert.equal(GetIntrinsic('%Math.pow%'), Math.pow); assert.equal(Math.pow(2, 3), 8); assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); delete Math.pow; assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); // instance methods var arr = [1]; assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push); assert.deepEqual(arr, [1]); arr.push(2); assert.deepEqual(arr, [1, 2]); GetIntrinsic('%Array.prototype.push%').call(arr, 3); assert.deepEqual(arr, [1, 2, 3]); delete Array.prototype.push; GetIntrinsic('%Array.prototype.push%').call(arr, 4); assert.deepEqual(arr, [1, 2, 3, 4]); // missing features delete JSON.parse; // to simulate a real intrinsic that is missing in the environment assert.throws(() => GetIntrinsic('%JSON.parse%')); assert.equal(undefined, GetIntrinsic('%JSON.parse%', true)); ``` -------------------------------- ### Installing project dependencies (Console) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/express/Readme.md After creating a new Express application or cloning a project, this command installs all the necessary dependencies listed in the project's package.json file. This is a crucial step before running the application. ```bash $ npm install ``` -------------------------------- ### Install anymatch Javascript Module Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/anymatch/README.md This command installs the anymatch Javascript module using npm. It's a prerequisite for using the module in your project. ```sh npm install anymatch ``` -------------------------------- ### Deprecating Property Access with 'depd' Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/depd/Readme.md This JavaScript example demonstrates how to use the 'depd' module to mark property access (get and set) as deprecated. It shows how to automatically derive the deprecation message from the property name and how to provide an explicit message. ```js var deprecate = require('depd')('my-cool-module') exports.oldprop = 'something' // message automatically derives from property name deprecate.property(exports, 'oldprop') // explicit message deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') ``` -------------------------------- ### Express/Connect Top-Level Generic Body Parsing Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/body-parser/README.md This example shows how to configure generic JSON and URL-encoded parsers as top-level middleware in an Express application. This setup ensures that all incoming request bodies are parsed. It requires the 'express' and 'body-parser' modules. ```javascript var express = require('express') var bodyParser = require('body-parser') var app = express() // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })) // parse application/json app.use(bodyParser.json()) app.use(function (req, res) { res.setHeader('Content-Type', 'text/plain') res.write('you posted:\n') res.end(JSON.stringify(req.body, null, 2)) }) ``` -------------------------------- ### Generate Documentation with Verb Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/fill-range/README.md This command installs the necessary tools globally and then executes the documentation generation process using 'verb'. This is part of the project's workflow for maintaining its README file, which is generated from a template. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Get proxied request address with named trust values Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/proxy-addr/README.md This example demonstrates using predefined names like 'loopback', 'linklocal', and 'uniquelocal' as trust values for the proxyaddr function. These names expand to their corresponding IP address ranges, simplifying configuration. ```javascript proxyaddr(req, 'loopback') proxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64']) ``` -------------------------------- ### Nodemon JSON Configuration Example Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/nodemon/doc/cli/config.txt Demonstrates a basic nodemon configuration using a JSON file. This configures file extensions, verbosity, and the execution command. ```json { "ext": "*.pde", "verbose": true, "exec": "processing --sketch=game --run" } ``` -------------------------------- ### Creating a new Express application (Console) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/express/Readme.md This command uses the globally installed Express Generator to create a new Express application in the specified directory ('/tmp/foo'). It then navigates into the newly created project directory. This is the first step in using the generator to start a new project. ```bash $ express /tmp/foo && cd /tmp/foo ``` -------------------------------- ### Usage Example: Securely calling Array.prototype.slice Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/call-bound/README.md Demonstrates how to use 'callBound' to get a secure reference to 'Array.prototype.slice'. It then removes the native 'call' and 'bind' from 'Function.prototype' and 'slice' from 'Array.prototype' to show that the 'slice' function obtained through 'callBound' still works correctly. ```javascript const assert = require('assert'); const callBound = require('call-bound'); const slice = callBound('Array.prototype.slice'); delete Function.prototype.call; delete Function.prototype.bind; delete Array.prototype.slice; assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); ``` -------------------------------- ### Initialize and Include Files in FileList (JavaScript) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/filelist/README.md Demonstrates how to create a new FileList instance and add files or glob patterns using the `include` method. This sets up the initial list of files to be potentially included. ```javascript var fl = new FileList(); fl.include('test/*.js'); fl.exclude('test/helpers.js'); ``` -------------------------------- ### Get Index Range of Balanced Pair in JavaScript Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/balanced-match/README.md This snippet illustrates the usage of the `balanced.range` function, which returns the start and end indices of the first non-nested matching pair of delimiters in a string. It's useful for operations that require precise location information of the matched pair. ```javascript var balanced = require('balanced-match'); console.log(balanced.range('{', '}', 'pre{in{nested}}post')); console.log(balanced.range('{', '}', 'pre{first}between{second}post')); ``` -------------------------------- ### Get proxied request address with function trust Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/proxy-addr/README.md This example shows how to use the proxyaddr function to determine the request's address. It utilizes a trust function to validate each IP address, returning the closest one that satisfies the trust criteria. The trust function can either check for a specific IP or a range. ```javascript proxyaddr(req, function (addr) { return addr === '127.0.0.1' }) proxyaddr(req, function (addr, i) { return i < 1 }) ``` -------------------------------- ### readdirp Stream API Examples Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/readdirp/README.md Demonstrates using the stream API of readdirp for efficient file system traversal. It includes examples using 'for await...of' and event listeners ('on'). ```javascript const readdirp = require('readdirp'); // Use streams to achieve small RAM & CPU footprint. // 1) Streams example with for-await. for await (const entry of readdirp('.')) { const {path} = entry; console.log(`${JSON.stringify({path})}`); } // 2) Streams example, non for-await. // Print out all JS files along with their size within the current folder & subfolders. readdirp('.', {fileFilter: '*.js', alwaysStat: true}) .on('data', (entry) => { const {path, stats: {size}} = entry; console.log(`${JSON.stringify({path, size})}`); }) // Optionally call stream.destroy() in `warn()` in order to abort and cause 'close' to be emitted .on('warn', error => console.error('non-fatal error', error)) .on('error', error => console.error('fatal error', error)) .on('end', () => console.log('done')); ``` -------------------------------- ### Install mime-types Node.js Module Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/mime-types/README.md Installs the 'mime-types' package using npm. This is a standard Node.js module and requires npm for installation. ```sh $ npm install mime-types ``` -------------------------------- ### Brace Expansion Examples: Sets and Sequences (Shell) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/braces/README.md Provides examples of brace expansion syntax commonly used in Unix-like shells. It covers expansion of sets (e.g., `{a,b,c}`) and sequences (e.g., `{1..9}`, `{a..j}`), including steps and reverse sequences. ```shell # Sets {a,b,c} => a b c {a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 # Sequences {1..9} => 1 2 3 4 5 6 7 8 9 {4..-4} => 4 3 2 1 0 -1 -2 -3 -4 {1..20..3} => 1 4 7 10 13 16 19 {a..j} => a b c d e f g h i j {j..a} => j i h g f e d c b a {a..z..3} => a d g j m p s v y # Combination {a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar ``` -------------------------------- ### Install EJS using npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/ejs/README.md This command installs the EJS templating engine using the Node Package Manager (npm). Ensure you have Node.js and npm installed on your system. ```bash npm install ejs ``` -------------------------------- ### Usage Example for side-channel-map Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/side-channel-map/README.md Demonstrates how to use the side-channel-map to store, retrieve, and assert the presence of values. It initializes a channel, sets a key-value pair, and then verifies its existence and retrieves the value. It also shows how to delete the key and the expected behavior when asserting a non-existent key. ```javascript const assert = require('assert'); const getSideChannelMap = require('side-channel-map'); const channel = getSideChannelMap(); const key = {}; assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); channel.set(key, 42); channel.assert(key); // does not throw assert.equal(channel.has(key), true); assert.equal(channel.get(key), 42); channel.delete(key); assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); ``` -------------------------------- ### Install toidentifier via npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/toidentifier/README.md This command installs the 'toidentifier' package using npm, making it available for use in your Node.js project. Ensure you have Node.js and npm installed. ```bash npm install toidentifier ``` -------------------------------- ### Picomatch Extglob Examples Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/picomatch/README.md Demonstrates the usage of Picomatch's extended globbing patterns (extglobs) such as *(pattern), +(pattern), and !(pattern). These patterns allow for more complex matching rules than basic wildcards. The examples show how to match zero or more, one or more, and anything but a specific pattern, including nested extglobs. ```javascript const pm = require('picomatch'); // *(pattern) matches ZERO or more of "pattern" console.log(pm.isMatch('a', 'a*(z)')); // true console.log(pm.isMatch('az', 'a*(z)')); // true console.log(pm.isMatch('azzz', 'a*(z)')); // true // +(pattern) matches ONE or more of "pattern" console.log(pm.isMatch('a', 'a+(z)')); // true console.log(pm.isMatch('az', 'a+(z)')); // true console.log(pm.isMatch('azzz', 'a+(z)')); // true // supports multiple extglobs console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false // supports nested extglobs console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true ``` -------------------------------- ### Install side-channel-weakmap Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/side-channel-weakmap/README.md This command installs the side-channel-weakmap package as a dependency for your project using npm. ```sh npm install --save side-channel-weakmap ``` -------------------------------- ### Client-Side EJS Rendering Example Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/ejs/README.md Provides an example of using EJS on the client-side by including `ejs.min.js`. It demonstrates rendering a template with data and updating the DOM using both jQuery and vanilla JavaScript. ```html
``` -------------------------------- ### Install side-channel-map Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/side-channel-map/README.md Installs the side-channel-map package as a project dependency using npm. ```sh npm install --save side-channel-map ``` -------------------------------- ### Install HTMX Skill via npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/README.md Installs the HTMX skill globally using npm. This command assumes the skill has been published as an npm package, providing an alternative installation method. ```bash npm install -g htmx-skill ``` -------------------------------- ### Install Cookie Module using npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/cookie/README.md This code snippet demonstrates how to install the 'cookie' Node.js module using the npm package manager. It assumes a Node.js environment with npm installed. ```sh npm install cookie ``` -------------------------------- ### Brace Matching Examples (Shell) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/braces/README.md Demonstrates how brace patterns can be used for matching strings, similar to regular expressions. Examples show matching specific sequences and combining braces with glob patterns for more complex filtering. ```shell # Basic matching foo/{1..3}/bar matches: foo/1/bar foo/2/bar foo/3/bar # Matching with globs */{1..3}/* matches: foo/1/bar foo/2/bar foo/3/bar baz/1/qux baz/2/qux baz/3/qux ``` -------------------------------- ### Usage Example: Accessing Binary Extensions Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/binary-extensions/readme.md Demonstrates how to import and use the 'binary-extensions' list in a JavaScript Node.js environment. The code logs the array of binary file extensions to the console. ```javascript const binaryExtensions = require('binary-extensions'); console.log(binaryExtensions); //=> ['3ds', '3g2', …] ``` -------------------------------- ### Install side-channel-list Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/side-channel-list/README.md This command installs the side-channel-list package as a dependency for your project using npm. ```sh npm install --save side-channel-list ``` -------------------------------- ### Instantiating Minimatch Class Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/nodemon/node_modules/minimatch/README.md Shows how to create a Minimatch object by instantiating the `minimatch.Minimatch` class with a pattern and optional configuration. This object can then be used for matching. ```javascript var Minimatch = require("minimatch").Minimatch var mm = new Minimatch(pattern, options) ``` -------------------------------- ### Incrementing Version with Prerelease Identifier (CLI) Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/semver/README.md Illustrates the command-line usage for incrementing a version and adding a prerelease identifier using the `semver` tool. Shows the command and its output. ```bash $ semver 1.2.3 -i prerelease --preid beta 1.2.4-beta.0 ``` -------------------------------- ### Install fill-range with npm Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/fill-range/README.md This command installs the fill-range package as a dependency for your project using npm. ```sh npm install --save fill-range ``` -------------------------------- ### Simple Static File Serving with Express Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/serve-static/README.md A basic example of using the 'serve-static' middleware with Express to serve files from the 'public/ftp' directory. It utilizes the default index file behavior. Dependencies include 'express' and 'serve-static'. ```javascript var express = require('express') var serveStatic = require('serve-static') var app = express() app.use(serveStatic('public/ftp', { index: ['default.html', 'default.htm'] })) app.listen(3000) ``` -------------------------------- ### Example Usage of callBindBasic Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/call-bind-apply-helpers/README.md Demonstrates how to use the 'callBindBasic' function from 'call-bind-apply-helpers'. It shows how to bind a function 'f' with a specific 'this' context (1) and then call the bound function with arguments (2, 3). The example verifies that the 'this' context and arguments are correctly passed to the original function. ```javascript const assert = require('assert'); const callBindBasic = require('call-bind-apply-helpers'); function f(a, b) { assert.equal(this, 1); assert.equal(a, 2); assert.equal(b, 3); assert.equal(arguments.length, 2); } const fBound = callBindBasic([f, 1]); delete Function.prototype.call; delete Function.prototype.bind; fBound(2, 3); ``` -------------------------------- ### Serve static files with Node.js http server Source: https://github.com/ercan-er/htmx-claude-skill/blob/main/examples/express-demo/node_modules/serve-static/README.md This example shows how to use serve-static with Node.js's built-in http module. It sets up a server to serve files from the 'public/ftp' directory with specific index files, using finalhandler for request handling. ```javascript var finalhandler = require('finalhandler') var http = require('http') var serveStatic = require('serve-static') // Serve up public/ftp folder var serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) // Create server var server = http.createServer(function onRequest (req, res) { serve(req, res, finalhandler(req, res)) }) // Listen server.listen(3000) ```