### Enable and Start Docker Service Source: https://github.com/voideditor/void/blob/main/scripts/appimage/readme.md Enables the Docker service to start on boot and starts the Docker service immediately. ```bash sudo systemctl enable docker sudo systemctl start docker ``` -------------------------------- ### Spdlog Example CMakeLists Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt CMakeLists.txt file for building the spdlog example program. ```cmake /Users/example/node_modules/@vscode/spdlog/deps/spdlog/example/CMakeLists.txt ``` -------------------------------- ### Socks Client Connect JavaScript Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt JavaScript example for establishing a SOCKS client connection. ```javascript const socks = require('socks'); const options = { proxy: { host: '127.0.0.1', port: 1080, type: 5 } }; const client = new socks.SocksClient(options); client.connect(() => { console.log('Connected via SOCKS proxy'); client.close(); }); ``` -------------------------------- ### Process Polyfill Browser Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Example of using the `process` polyfill in a browser environment. ```javascript var process = require('process'); console.log(process.env.NODE_ENV); ``` -------------------------------- ### Buffer Equality Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt An example demonstrating the usage of buffer equality comparison. ```javascript var eq = require('../').eq; eq(new Buffer('abc'), new Buffer('abc')); ``` -------------------------------- ### NPM Run All - Main CLI Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Shows a basic example of using the 'npm-run-all' command directly from the command line to run multiple scripts. ```javascript # Example usage in terminal: # Assuming you have scripts like 'build:js', 'build:css', 'test:unit', 'test:integration' # Run build scripts in parallel npm-run-all --parallel build:js build:css # Run test scripts sequentially npm-run-all --serial test:unit test:integration # Run all scripts (default is parallel) npm-run-all build:js build:css test:unit test:integration ``` -------------------------------- ### Spdlog Example Usage (C++) Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Example C++ program demonstrating how to use the spdlog library for logging. ```cpp /Users/example/node_modules/@vscode/spdlog/deps/spdlog/example/example.cpp ``` -------------------------------- ### Node.js pidtree Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Illustrates how to get the PIDs of child processes using the pidtree module. This is useful for process management and monitoring. ```javascript var pidtree = require('pidtree') pidtree(process.pid, function (err, pids) { if (err) throw err console.log(pids) }) ``` -------------------------------- ### Install Dependencies Source: https://github.com/voideditor/void/blob/main/test/monaco/README.md Installs project dependencies using npm. ```bash npm i ``` -------------------------------- ### Wildcard Examples (Strings) Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt This snippet shows an example of using the wildcard module with strings. ```javascript examples/strings.js ``` -------------------------------- ### Fastq Queue Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates the basic usage of the fastq library for creating and managing a task queue. ```javascript const fastq = require('fastq'); // Create a queue with a concurrency of 2 const queue = fastq((task, cb) => { console.log('Processing task:', task); // Simulate async work setTimeout(() => { console.log('Finished task:', task); cb(null, 'Task ' + task + ' completed'); }, Math.random() * 1000); }, 2); // Add tasks to the queue for (let i = 1; i <= 5; i++) { queue.push(i, (err, result) => { if (err) { console.error('Error:', err); } else { console.log('Callback result:', result); } }); } console.log('All tasks added to the queue.'); ``` -------------------------------- ### Load Example Strada Source Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/pfs/fixtures/index.html Populates the 'stradaSrc' pane with selected example code. It fetches the example code from the server and then triggers an update of the compiled output. ```JavaScript function exampleSelectionChanged() { var examples = document.getElementById('examples'); var selectedExample = examples.options[examples.selectedIndex].value; if (selectedExample != "") { $.get('examples/' + selectedExample, function (srcText) { $('#stradaSrc').val(srcText); setTimeout(srcUpdated, 100); }, function (err) { console.log(err); }); } } ``` -------------------------------- ### Load Example Source Code Source: https://github.com/voideditor/void/blob/main/src/vs/workbench/services/search/test/node/fixtures/index.html Loads selected example source code from the 'examples/' directory into the '#stradaSrc' pane. It then triggers a recompilation. ```javascript function exampleSelectionChanged() { var examples = document.getElementById('examples'); var selectedExample = examples.options[examples.selectedIndex].value; if (selectedExample != "") { $.get('examples/' + selectedExample, function (srcText) { $('#stradaSrc').val(srcText); setTimeout(srcUpdated,100); }, function (err) { console.log(err); }); } } ``` -------------------------------- ### Fastq Example with Promises Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Shows how to use the fastq library with promises for asynchronous task handling. ```typescript import fastq from 'fastq'; interface Task { id: number; } interface Result { message: string; } // Create a queue that returns promises const queue = fastq.promise(async (task) => { console.log(`Processing task ${task.id}...`); await new Promise(resolve => setTimeout(resolve, Math.random() * 500)); console.log(`Finished task ${task.id}.`); return { message: `Task ${task.id} processed successfully` }; }, 3); // Concurrency of 3 async function run() { const tasks = Array.from({ length: 10 }, (_, i) => ({ id: i + 1 })); // Map tasks to promises and wait for all to complete const results = await Promise.all(tasks.map(task => queue.push(task))); console.log('All tasks completed:'); results.forEach(result => console.log(result.message)); } run().catch(console.error); ``` -------------------------------- ### Install Docker on Ubuntu Source: https://github.com/voideditor/void/blob/main/scripts/appimage/readme.md Installs Docker on Ubuntu systems using the apt package manager. ```bash sudo apt install docker.io ``` -------------------------------- ### Install Node-Gyp on Linux Source: https://github.com/voideditor/void/blob/main/HOW_TO_CONTRIBUTE.md Run this command to install node-gyp globally on Linux systems, which is a prerequisite for building Node.js addons. ```bash npm install -g node-gyp ``` -------------------------------- ### Colors Package Files and Examples Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Details files and example usage for the 'colors' package, used for terminal string styling. ```plaintext /Users/example/build/node_modules/colors/LICENSE /Users/example/build/node_modules/colors/safe.js /Users/example/build/node_modules/colors/README.md /Users/example/build/node_modules/colors/package.json /Users/example/build/node_modules/colors/examples/normal-usage.js /Users/example/build/node_modules/colors/examples/safe-string.js /Users/example/build/node_modules/colors/lib/maps/random.js /Users/example/build/node_modules/colors/lib/maps/zebra.js /Users/example/build/node_modules/colors/lib/maps/rainbow.js /Users/example/build/node_modules/colors/lib/maps/america.js /Users/example/build/node_modules/colors/lib/index.js /Users/example/build/node_modules/colors/lib/extendStringPrototype.js /Users/example/build/node_modules/colors/lib/system/has-flag.js /Users/example/build/node_modules/colors/lib/system/supports-colors.js /Users/example/build/node_modules/colors/lib/colors.js /Users/example/build/node_modules/colors/lib/custom/trap.js /Users/example/build/node_modules/colors/lib/custom/zalgo.js /Users/example/build/node_modules/colors/lib/styles.js /Users/example/build/node_modules/colors/index.d.ts /Users/example/build/node_modules/colors/themes/generic-logging.js /Users/example/build/node_modules/colors/safe.d.ts ``` ```javascript require('colors'); console.log('this is a red string'.red); console.log('this is a blue string'.blue); console.log('this is a bold string'.bold); console.log('this is a green string'.green); console.log('this is a yellow string'.yellow); console.log('this is a cyan string'.cyan); console.log('this is a magenta string'.magenta); console.log('this is a white string'.white); console.log('this is a gray string'.gray); console.log('this is a black string'.black); console.log('this is a strikethrough string'.strikethrough); console.log('this is an underline string'.underline); console.log('this is a inverse string'.inverse); console.log('this is a bold and red string'.bold.red); console.log('this is a red and bold string'.red.bold); console.log('this is a rainbow string'.rainbow); console.log('this is a zebra string'.zebra); console.log('this is a america string'.america); console.log('this is a random string'.random); console.log('this is a trap string'.trap); ``` ```javascript var colors = require('../lib/colors'); colors.setTheme({ info: 'green', warning: 'yellow', error: 'red' }); console.log('this is an info message'.info); console.log('this is a warning message'.warning); console.log('this is an error message'.error); ``` -------------------------------- ### Fstream - Reader Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates creating a basic fstream reader to access file system entries. ```javascript var fstream = require('../'); var path = require('path'); var reader = fstream.Reader({ path: process.cwd(), type: 'Directory' }); reader.on('data', function (entry) { console.log(entry.path); }); ``` -------------------------------- ### Socks Client TypeScript Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt TypeScript example for establishing a SOCKS client connection. ```typescript import * as socks from 'socks'; const options: socks.Client.ISocksClientOptions = { proxy: { host: '127.0.0.1', port: 1080, type: 5 } }; const client = new socks.SocksClient(options); client.connect(() => { console.log('Connected via SOCKS proxy'); client.close(); }); ``` -------------------------------- ### Socks Client Bind JavaScript Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt JavaScript example for binding a SOCKS client. ```javascript const socks = require('socks'); const options = { proxy: { host: '127.0.0.1', port: 1080, type: 5 } }; const client = new socks.SocksClient(options); client.bind(() => { console.log('SOCKS client bound'); client.close(); }); ``` -------------------------------- ### Wildcard Examples (Objects) Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt This snippet shows an example of using the wildcard module with objects. ```javascript examples/objects.js ``` -------------------------------- ### Socks Client Associate JavaScript Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt JavaScript example for associating a SOCKS client. ```javascript const socks = require('socks'); const options = { proxy: { host: '127.0.0.1', port: 1080, type: 5 } }; const client = new socks.SocksClient(options); client.associate(() => { console.log('SOCKS client associated'); client.close(); }); ``` -------------------------------- ### Wildcard Examples (Arrays) Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt This snippet shows an example of using the wildcard module with arrays. ```javascript examples/arrays.js ``` -------------------------------- ### Install Dependencies Source: https://github.com/voideditor/void/blob/main/HOW_TO_CONTRIBUTE.md Install all project dependencies using npm. Ensure Node.js version 20.18.2 is used. ```bash npm install ``` -------------------------------- ### Fstream - Pipe Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt A basic example demonstrating the core piping functionality of fstream for streaming file data. ```javascript var fstream = require('../'); var path = require('path'); var reader = fstream.Reader({ path: process.cwd(), type: 'Directory' }); var writer = fstream.Writer(process.env.DEST || './tmp'); reader.pipe(writer); ``` -------------------------------- ### Install Docker on Fedora Source: https://github.com/voideditor/void/blob/main/scripts/appimage/readme.md Installs Docker on Fedora systems using the dnf package manager. ```bash sudo dnf install docker ``` -------------------------------- ### Root Path Link Source: https://github.com/voideditor/void/blob/main/extensions/markdown-language-features/test-workspace/a.md Demonstrates creating a link starting from the root directory. ```markdown [/b.md](/b.md) ``` -------------------------------- ### Node.js Module: github-from-package example/url.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Example script demonstrating how to use 'github-from-package' to parse repository URLs. ```javascript var githubFromPackage = require('../') var pkg = { name: 'my-cool-package', version: '1.0.0', repository: 'git://github.com/user/repo.git' } console.log(githubFromPackage(pkg)) var pkg2 = { name: 'another-package', version: '2.0.0', repository: { type: 'git', url: 'https://github.com/user/another-repo.git' } } console.log(githubFromPackage(pkg2)) ``` -------------------------------- ### Install Docker on Arch Linux Source: https://github.com/voideditor/void/blob/main/scripts/appimage/readme.md Installs Docker on Arch Linux systems using the pacman package manager. ```bash sudo pacman -S docker ``` -------------------------------- ### JSON Server Configuration Example Source: https://github.com/voideditor/void/blob/main/extensions/json-language-features/server/README.md Example of a client-side configuration object for the JSON language server, specifying HTTP proxy settings and JSON-specific configurations like formatting and schema associations. ```json { "http": { "proxy": "", "proxyStrictSSL": true }, "json": { "format": { "enable": true }, "schemas": [ { "fileMatch": [ "foo.json", "*.superfoo.json" ], "url": "http://json.schemastore.org/foo", "schema": { "type": "array" } } ] } } ``` -------------------------------- ### Cloneable Readable Stream Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates how to create and use a cloneable readable stream. ```javascript const cloneable = require('cloneable-readable'); const readable = cloneable(process.stdin); const reader1 = readable.get(); const reader2 = readable.get(); reader1.on('data', (chunk) => { console.log('reader1:', chunk.toString()); }); reader2.on('data', (chunk) => { console.log('reader2:', chunk.toString()); }); process.stdin.pipe(reader1); process.stdin.pipe(reader2); ``` -------------------------------- ### Minimist Example Usage Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt This JavaScript file provides an example of how to use the 'minimist' library to parse command-line arguments. It showcases basic parsing functionality. ```javascript var parse = require('../'); var argv = parse(process.argv.slice(2)); console.log(argv); ``` -------------------------------- ### Node.js Events Module Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates the usage of the Node.js EventEmitter. ```javascript const EventEmitter = require('events'); class MyEmitter extends EventEmitter {} const myEmitter = new MyEmitter(); myEmitter.on('event', () => { console.log('An event occurred!'); }); myEmitter.emit('event'); ``` -------------------------------- ### Readme Markdown Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Markdown file containing the project's README, typically including project description, installation instructions, and usage examples. ```markdown # resolve Statically analyze and resolve paths in node.js module lookup including the browser field [![build status](https://secure.travis-ci.org/browserify/resolve.svg?branch=master)](http://travis-ci.org/browserify/resolve) [![npm version](https://badge.fury.io/js/resolve.svg)](https://badge.fury.io/js/resolve) ## example ```javascript var resolve = require('resolve'); resolve('./foo', { basedir: __dirname }, function (err, res, pkg) { if (err) console.error(err); console.log(res, pkg); }); ``` ## install ```bash npm install resolve ``` ## usage ```javascript var resolve = require('resolve'); resolve(moduleName, [opts], [cb]) ``` ### `resolve(id, opts, cb)` Asynchronously resolve `id` relative to `opts.basedir` or `opts.filename`. ### `resolve.sync(id, opts)` Synchronously resolve `id` relative to `opts.basedir` or `opts.filename`. ### `opts * `basedir` - The directory to resolve relative to. Defaults to `process.cwd()`. * `filename` - The filename to resolve relative to. Defaults to `opts.basedir`. * `packageFilter` - A function that takes `pkg`, `filepath` and returns a modified `pkg`. This can be used to filter the `package.json` contents. For example, to use the `browser` field: ```javascript resolve(moduleName, { packageFilter: function (pkg, pkgFile) { if (typeof pkg.browser === 'string') { pkg.main = pkg.browser; } else if (typeof pkg.browser === 'object') { pkg.main = pkg.browser[path.basename(pkgFile)] || pkg.main; } return pkg; } }, cb); ``` * `paths` - An array of paths to search for node_modules. Defaults to `process.nodeModulePaths`. ### `cb(err, filename, pkg)` * `err` - An error if the module could not be resolved. * `filename` - The resolved filename. * `pkg` - The package.json for the resolved module. ## license MIT ``` -------------------------------- ### Object Inspect Browser DOM Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates how to use the 'object-inspect' library to inspect DOM elements in a browser environment. Requires specific setup for DOM manipulation. ```javascript var inspect = require('../..'); var div = document.createElement('div'); div.style.cssText = 'color: red;'; div.className = 'foo'; div.setAttribute('data-foo', 'bar'); var span = document.createElement('span'); span.appendChild(document.createTextNode('hello')); div.appendChild(span); console.log(inspect(div)); // Should output something like: //
// hello //
``` -------------------------------- ### NPM Run All - Run-s Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates running npm scripts sequentially using the 'run-s' command from 'npm-run-all'. ```javascript // Example package.json script: // "scripts": { // "lint": "echo Linting... && sleep 1", // "test": "echo Testing... && sleep 1", // "build": "run-s lint test" // } // To run this, you would execute 'npm run build' in your terminal. // This command will execute 'lint' first, and then 'test' after 'lint' completes. ``` -------------------------------- ### Node-API Nothing C Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt A minimal C file for Node-API, likely used for testing or as a placeholder. ```c /* Nothing */ ``` -------------------------------- ### Install and Use Specific Node Version Source: https://github.com/voideditor/void/blob/main/HOW_TO_CONTRIBUTE.md Install and use a specific Node.js version (e.g., 20.18.2 from .nvmrc) locally without altering the global Node.js installation. ```bash nvm install ``` ```bash nvm use ``` -------------------------------- ### npm-run-all bin/run-p/help.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Provides help information for the 'run-p' command in npm-run-all. Displays usage instructions and options. ```javascript "use strict" const help = require("../common/help") console.log(help("run-p", { usage: "run-p ", description: "Run multiple npm scripts in parallel.", options: { "-s, --serial": "Run tasks serially instead of in parallel.", "-n, --npm-path ": "Path to npm executable.", "-p, --prefix ": "Prefix to add to each command.", "-l, --local-path ": "Path to local npm module.", "-h, --help": "Output usage information.", "-v, --version": "Output the version number." } })) ``` -------------------------------- ### HTMLParser2 WritableStream Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Example of using the ESM version of the HTMLParser2 WritableStream. ```javascript import { WritableStream } from 'htmlparser2'; const stream = new WritableStream({ onopentag(name, attribs) { console.log('onopentag', name, attribs); }, ontext(text) { console.log('ontext', text); }, onclosetag(name) { console.log('onclosetag', name); } }); stream.end('

Hello World

'); ``` -------------------------------- ### Node.js Module README Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Shows the path to a README file for a Node.js module. README files are crucial for understanding package functionality and usage. ```text /Users/example/node_modules/is-buffer/README.md ``` -------------------------------- ### HTMLParser2 ESM Parser Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Example of using the ESM version of the HTMLParser2 Parser. ```javascript import { Parser } from 'htmlparser2'; const parser = new Parser({ onopentag(name, attribs) { console.log('onopentag', name, attribs); }, ontext(text) { console.log('ontext', text); }, onclosetag(name) { console.log('onclosetag', name); } }); parser.write('

Hello World

'); parser.end(); ``` -------------------------------- ### npm-run-all bin/npm-run-all/help.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Provides help information for the main 'npm-run-all' command. Displays usage instructions and options. ```javascript "use strict" const help = require("../common/help") console.log(help("npm-run-all", { usage: "npm-run-all ", description: "Run multiple npm scripts.", options: { "-p, --parallel": "Run tasks in parallel (default).", "-s, --serial": "Run tasks serially.", "-n, --npm-path ": "Path to npm executable.", "-c, --continue-on-error": "Continue running tasks even if one fails.", "-l, --local-path ": "Path to local npm module.", "-h, --help": "Output usage information.", "-v, --version": "Output the version number." } })) ``` -------------------------------- ### NPM Run All - Run-p Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Illustrates how to run multiple npm scripts in parallel using the 'run-p' command from 'npm-run-all'. ```javascript // Example package.json script: // "scripts": { // "build:js": "echo Building JS... && sleep 1", // "build:css": "echo Building CSS... && sleep 1", // "build": "run-p build:js build:css" // } // To run this, you would execute 'npm run build' in your terminal. // This command will execute 'build:js' and 'build:css' concurrently. ``` -------------------------------- ### Start JSON Language Server with Communication Channels Source: https://github.com/voideditor/void/blob/main/extensions/json-language-features/server/README.md Launch the JSON language server using the command line, specifying the preferred communication channel. ```bash vscode-json-languageserver --node-ipc ``` ```bash vscode-json-languageserver --stdio ``` ```bash vscode-json-languageserver --socket= ``` -------------------------------- ### npm-run-all bin/run-s/help.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Provides help information for the 'run-s' command in npm-run-all. Displays usage instructions and options. ```javascript "use strict" const help = require("../common/help") console.log(help("run-s", { usage: "run-s ", description: "Run multiple npm scripts serially.", options: { "-n, --npm-path ": "Path to npm executable.", "-p, --prefix ": "Prefix to add to each command.", "-l, --local-path ": "Path to local npm module.", "-h, --help": "Output usage information.", "-v, --version": "Output the version number." } })) ``` -------------------------------- ### Glob Sync Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates the synchronous usage of the glob module for finding files. This is useful for simple scripting or when immediate results are needed. ```javascript /Users/example/node_modules/tsec/node_modules/glob/sync.js ``` -------------------------------- ### Socks Client Associate TypeScript Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt TypeScript example for associating a SOCKS client. ```typescript import * as socks from 'socks'; const options: socks.Client.ISocksClientOptions = { proxy: { host: '127.0.0.1', port: 1080, type: 5 } }; const client = new socks.SocksClient(options); client.associate(() => { console.log('SOCKS client associated'); client.close(); }); ``` -------------------------------- ### Socks Client Bind TypeScript Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt TypeScript example for binding a SOCKS client. ```typescript import * as socks from 'socks'; const options: socks.Client.ISocksClientOptions = { proxy: { host: '127.0.0.1', port: 1080, type: 5 } }; const client = new socks.SocksClient(options); client.bind(() => { console.log('SOCKS client bound'); client.close(); }); ``` -------------------------------- ### Build Void Executable for Windows (x64) Source: https://github.com/voideditor/void/blob/main/HOW_TO_CONTRIBUTE.md Run this command to build a local executable for Windows (64-bit). Ensure you have entered Developer Mode first. ```bash npm run gulp vscode-win32-x64 ``` -------------------------------- ### Indent Guides CSS Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.test.data.txt CSS styles for indent guides in the VS Code editor. ```css /users/foo/src/vs/editor/browser/viewParts/indentGuides/indentGuides.css ``` -------------------------------- ### Glob Pattern Matching with Picomatch Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt This example demonstrates using the 'picomatch' library for glob pattern matching. It's useful for matching file paths against patterns, commonly used in build tools and file system operations. ```javascript const picomatch = require('picomatch'); const isFile = picomatch('*.js'); console.log(isFile('index.js')); // => true console.log(isFile('index.jsx')); // => false ``` -------------------------------- ### Indent Guides TypeScript Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.test.data.txt TypeScript code for indent guides in the VS Code editor. ```typescript /users/foo/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts ``` -------------------------------- ### Fstream - Symlink Write Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Illustrates how to create symbolic links using fstream's writer. ```javascript var fstream = require('../'); var path = require('path'); var reader = fstream.Reader({ path: process.cwd(), type: 'Directory' }); var writer = fstream.Writer({ path: process.env.DEST || './tmp', type: 'Symlink', linkname: process.cwd() }); reader.pipe(writer); ``` -------------------------------- ### Doctest Block Example Source: https://github.com/voideditor/void/blob/main/extensions/vscode-colorize-tests/test/colorize-fixtures/test.rst Shows a doctest block, which can be used for interactive Python examples and testing. ```python >>> 2 +3 5 ``` -------------------------------- ### Octokit Endpoint with Defaults Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates how to use @octokit/endpoint with default configurations. ```javascript import { endpointWithDefaults } from "@octokit/endpoint"; const endpoint = endpointWithDefaults({ baseUrl: "https://api.github.com", headers: { accept: "application/vnd.github.v3+json" } }); endpoint({ method: "GET", url: "/users/octocat" }).then(response => { console.log(response.data); }); ``` -------------------------------- ### Build Void Executable for Windows (ARM64) Source: https://github.com/voideditor/void/blob/main/HOW_TO_CONTRIBUTE.md Run this command to build a local executable for Windows on ARM64 architecture. Ensure you have entered Developer Mode first. ```bash npm run gulp vscode-win32-arm64 ``` -------------------------------- ### Event-stream examples: map.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt An example script demonstrating the use of the 'map' stream utility for transforming data. ```javascript var es = require('event-stream'); var source = es.readable(function(count, callback) { if (count < 3) { this.emit('data', 'value ' + count); callback(null, count + 1); } else { this.emit('end'); } }); var transform = es.map(function(data, callback) { callback(null, data.toUpperCase()); }); source.pipe(transform).on('data', function(data) { console.log('Mapped data:', data); }); // Output: // Mapped data: VALUE 0 // Mapped data: VALUE 1 // Mapped data: VALUE 2 ``` -------------------------------- ### Minimist Example Usage Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt This snippet shows an example of how to use the 'minimist' module for parsing command-line arguments. ```javascript /Users/example/test/automation/node_modules/minimist/example/parse.js ``` -------------------------------- ### npm-run-all lib/create-header.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Creates a header string for logging task output. Includes the task name and prefix. ```javascript "use strict" module.exports = prefix => task => { return `\n> ${prefix}${task}\n` } ``` -------------------------------- ### Install JSON Language Server Source: https://github.com/voideditor/void/blob/main/extensions/json-language-features/server/README.md Install the vscode-json-languageserver npm module globally to use the language server. ```bash npm install -g vscode-json-languageserver ``` -------------------------------- ### Node.js Brace Expansion Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Illustrates brace expansion capabilities with the 'brace-expansion' module. This is helpful for generating combinations of strings. ```javascript const expand = require('brace-expansion'); expand('foo/{bar,baz}/qux', function(err, files) { if (err) throw err; console.log(files); // [ 'foo/bar/qux', 'foo/baz/qux' ] }); ``` -------------------------------- ### Build Void Executable for Linux (x64) Source: https://github.com/voideditor/void/blob/main/HOW_TO_CONTRIBUTE.md Run this command to build a local executable for Linux (64-bit). Ensure you have entered Developer Mode first. ```bash npm run gulp vscode-linux-x64 ``` -------------------------------- ### Octokit Endpoint Defaults Configuration Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Illustrates setting up default configurations for @octokit/endpoint. ```javascript import { withDefaults } from "@octokit/endpoint"; const defaults = { baseUrl: "https://api.github.com", headers: { accept: "application/vnd.github.v3+json" } }; const endpoint = withDefaults(defaults); endpoint({ method: "GET", url: "/users/octocat" }).then(response => { console.log(response.data); }); ``` -------------------------------- ### Event-stream examples: pretty.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt An example script demonstrating stream formatting or 'beautifying' data, likely for better readability. ```javascript var es = require('event-stream'); // This is a conceptual example. 'pretty' is not a standard event-stream function. // It likely involves a custom transform stream for formatting output. var dataStream = es.readable(function(count, callback) { if (count < 2) { this.emit('data', { message: 'log entry ' + count }); callback(null, count + 1); } else { this.emit('end'); } }); // Hypothetical 'pretty' transform stream var prettyStream = es.map(function(data, callback) { callback(null, JSON.stringify(data, null, 2)); // Pretty print JSON }); dataStream.pipe(prettyStream).on('data', function(formattedData) { console.log('Pretty Output:\n', formattedData); }); // Output: // Pretty Output: // { // "message": "log entry 0" // } // Pretty Output: // { // "message": "log entry 1" // } ``` -------------------------------- ### Event-stream examples: split.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt An example script demonstrating the use of the 'split' stream utility for processing line-based data. ```javascript var es = require('event-stream'); var split = require('split'); var stream = es.readable(function(count, callback) { if (count < 3) { this.emit('data', 'line ' + count + '\n'); callback(null, count + 1); } else { this.emit('end'); } }); stream.pipe(split()).on('data', function(line) { console.log('Split line:', line); }); // Output: // Split line: line 0 // Split line: line 1 // Split line: line 2 ``` -------------------------------- ### Node.js Module Resolution Examples Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Example usage of the 'resolve' module for synchronous and asynchronous module resolution in Node.js. ```javascript const resolve = require("../"); exports.sync = function (t) { t.plan(1); t.equal(resolve.sync("foo"), __dirname + "/test/resolver/foo.js"); }; ``` ```javascript const resolve = require("../"); exports.async = function (t) { t.plan(1); resolve("foo", function (err, res) { if (err) throw err; t.equal(res, __dirname + "/test/resolver/foo.js"); }); }; ``` -------------------------------- ### Event-stream pipeline example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Demonstrates creating a stream pipeline where the output of one stream becomes the input of the next using 'pipeline' from event-stream. ```javascript var es = require('event-stream'); var source = es.readable(function(count, callback) { if (count < 3) { this.emit('data', 'data-' + count); callback(null, count + 1); } else { this.emit('end'); } }); var transform = es.map(function(data, callback) { callback(null, data.toUpperCase()); }); var destination = es.writable(function(data, callback) { console.log('Processed:', data); callback(); }); es.pipeline(source, transform, destination); // Output: // Processed: DATA-0 // Processed: DATA-1 // Processed: DATA-2 ``` -------------------------------- ### npm-run-all bin/npm-run-all/index.js Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Entry point for the main 'npm-run-all' command. Handles parsing arguments and executing tasks based on options. ```javascript "use strict" const npmRunAll = require("../lib/index") const parseArgs = require("../common/parse-cli-args") npmRunAll(parseArgs(process.argv.slice(2))) .catch(err => { console.error(err.message) process.exit(err.exitCode) }) ``` -------------------------------- ### Color Convert - Route Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Illustrates the routing mechanism within the 'color-convert' library, mapping color names to their conversion functions. ```javascript const conversions = require('color-convert/conversions'); const routes = require('color-convert/route'); // Example: Get the conversion route from RGB to HSL const rgbToHslRoute = routes.get('rgb', 'hsl'); console.log('RGB to HSL route:', rgbToHslRoute); // Output might look like: [ 'rgb', 'hsl' ] or similar, indicating the path. // Example: Get the conversion function for a specific route const rgbToHslConverter = conversions.get(rgbToHslRoute); if (rgbToHslConverter) { const rgbColor = [255, 0, 0]; // Red const hslColor = rgbToHslConverter(rgbColor); console.log(`RGB ${rgbColor} converts to HSL:`, hslColor); } else { console.log('Conversion route or function not found.'); } ``` -------------------------------- ### Is Plain Object - Dist MJS Example Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt Provides an example of using the 'is-plain-object' utility function from its ES Module build. ```javascript import isPlainObject from 'is-plain-object/dist/is-plain-object.mjs'; const obj1 = { a: 1 }; const arr = [1, 2, 3]; const str = 'hello'; const num = 123; console.log(`Is { a: 1 } a plain object?`, isPlainObject(obj1)); // true console.log(`Is [1, 2, 3] a plain object?`, isPlainObject(arr)); // false console.log(`Is 'hello' a plain object?`, isPlainObject(str)); // false console.log(`Is 123 a plain object?`, isPlainObject(num)); // false // Example with a class instance (not a plain object) class MyClass { constructor() { this.a = 1; } } const instance = new MyClass(); console.log(`Is MyClass instance a plain object?`, isPlainObject(instance)); // false ``` -------------------------------- ### Launch Developer Mode (Windows/Linux) Source: https://github.com/voideditor/void/blob/main/HOW_TO_CONTRIBUTE.md Open the Void Developer Mode window on Windows or Linux. Consider adding user data and extension directory flags for a clean environment. ```bash ./scripts/code.bat ``` ```bash ./scripts/code.sh ``` ```bash ./scripts/code.sh --user-data-dir ./.tmp/user-data --extensions-dir ./.tmp/extensions ``` -------------------------------- ### Install Seti-UI Dependencies Source: https://github.com/voideditor/void/blob/main/extensions/theme-seti/README.md Install npm dependencies for seti-ui after cloning it locally. This is a prerequisite for generating updated icons from a local copy. ```bash npm install npm run prepublishOnly ``` -------------------------------- ### Get Visitor Keys for ESLint Source: https://github.com/voideditor/void/blob/main/src/vs/base/test/node/uri.perf.data.txt A utility function to get visitor keys for ESLint AST nodes. This is part of the @typescript-eslint/visitor-keys package. ```javascript var getKeys = require('@typescript-eslint/visitor-keys/get-keys'); // Example usage: Get visitor keys for a 'Program' node var keys = getKeys('Program'); console.log(keys); // ['body'] ```