### Development Setup Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/json5/README.md Steps to clone the repository, install dependencies, and set up for development. ```sh git clone https://github.com/json5/json5 cd json5 npm install ``` -------------------------------- ### Install Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/electron-to-chromium/README.md Install using `npm install electron-to-chromium`. ```bash npm install electron-to-chromium ``` -------------------------------- ### Get all versions with support property Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/baseline-browser-mapping/README.md Example of how to use the useSupports option to replace 'wa_compatible' with a 'supports' property indicating feature support. ```javascript getAllVersions({ useSupports: true, }); ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/js-tokens/README.md Installation instructions for js-tokens. ```bash npm install js-tokens ``` ```javascript import jsTokens from "js-tokens" // or: var jsTokens = require("js-tokens").default ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@types/babel__template/README.md Install the @types/babel__template package using npm. ```bash npm install --save @types/babel__template ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@types/babel__core/README.md Install the @types/babel__core package using npm. ```bash npm install --save @types/babel__core ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/react-dom/README.md Installs both react and react-dom packages. ```sh npm install react react-dom ``` -------------------------------- ### Install Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/picomatch/README.md Install picomatch with npm. ```sh npm install --save picomatch ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/core/README.md Install @babel/core using yarn. ```sh yarn add @babel/core --dev ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@types/estree/README.md Install the @types/estree package using npm. ```bash npm install --save @types/estree ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/helpers/README.md Install @babel/helpers using yarn. ```sh yarn add @babel/helpers --dev ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/helper-plugin-utils/README.md Install the @babel/helper-plugin-utils package using yarn. ```sh yarn add @babel/helper-plugin-utils ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/debug/README.md Install the debug package using npm. ```bash $ npm install debug ``` -------------------------------- ### Install with npm Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/helpers/README.md Install @babel/helpers using npm. ```sh npm install --save-dev @babel/helpers ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/plugin-transform-react-jsx-source/README.md Install the plugin using yarn. ```sh yarn add @babel/plugin-transform-react-jsx-source --dev ``` -------------------------------- ### Install with npm Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/core/README.md Install @babel/core using npm. ```sh npm install --save-dev @babel/core ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/helper-string-parser/README.md Install the @babel/helper-string-parser package using yarn. ```sh yarn add @babel/helper-string-parser ``` -------------------------------- ### Install with npm Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/plugin-transform-react-jsx-source/README.md Install the plugin using npm. ```sh npm install --save-dev @babel/plugin-transform-react-jsx-source ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/helper-module-transforms/README.md Install @babel/helper-module-transforms using yarn. ```sh yarn add @babel/helper-module-transforms ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/compat-data/README.md Install the @babel/compat-data package using yarn. ```sh yarn add @babel/compat-data ``` -------------------------------- ### matchToToken usage example Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/js-tokens/README.md Example of how to use matchToToken to get token details. ```javascript import {matchToToken} from "js-tokens" // or: var matchToToken = require("js-tokens").matchToToken ``` -------------------------------- ### Output Format: CSV Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/baseline-browser-mapping/README.md Example of setting outputFormat to 'csv' to get comma-separated values. ```javascript getAllVersions({ outputFormat: "csv", }); ``` -------------------------------- ### Quickstart Usage Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/fdir/README.md Create a crawler instance, configure it, and then crawl a directory synchronously or asynchronously. ```typescript import { fdir } from "fdir"; // create the builder const api = new fdir().withFullPaths().crawl("path/to/dir"); // get all files in a directory synchronously const files = api.sync(); // or asynchronously api.withPromise().then((files) => { // do something with the result here. }); ``` -------------------------------- ### Install semver Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/semver/README.md How to install the semver package using npm. ```bash npm install semver ``` -------------------------------- ### Output Format: Object Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/baseline-browser-mapping/README.md Example of setting outputFormat to 'object' to get nested browser versions. ```javascript getAllVersions({ outputFormat: "object", }); ``` -------------------------------- ### Get all browser versions Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/baseline-browser-mapping/README.md Example of how to import and call the getAllVersions function to retrieve data for all browser versions. ```javascript import { getAllVersions } from "baseline-browser-mapping"; getAllVersions(); ``` -------------------------------- ### Build and Run from Source Source: https://github.com/starrykira/copilot2api-go/blob/master/README.md Instructions for building the project from source and running the executable. ```bash # Build go build -o copilot-go . # Run (from project root so web UI is served) ./copilot-go ``` -------------------------------- ### Importing fullVersions Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/electron-to-chromium/README.md How to import the 'fullVersions' list. ```javascript var fullVersions = require('electron-to-chromium/full-versions'); ``` -------------------------------- ### jsesc Binary Usage - Basic Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/jsesc/README.md Example of escaping a string from the command line using the globally installed jsesc binary. ```bash npm install -g jsesc $ jsesc 'föo ♥ bår 𝌆 baz' föo baz ``` -------------------------------- ### Clean function examples Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/semver/README.md Examples demonstrating the behavior of the clean function. ```javascript s.clean(' = v 2.1.5foo') s.clean('=v2.1.5') s.clean(' =v2.1.5') s.clean(' 2.1.5 ') s.clean('~1.0.0') ``` -------------------------------- ### Get a reference to the module Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/source-map-js/README.md Examples of how to import or access the source-map module in different environments (Node.js, browser, Firefox). ```javascript // Node.js var sourceMap = require('source-map'); // Browser builds var sourceMap = window.sourceMap; // Inside Firefox const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); ``` -------------------------------- ### Docker Deployment Source: https://github.com/starrykira/copilot2api-go/blob/master/README.md Instructions for building and running the project using Docker. ```bash # Build image docker build -t copilot-go . # Run (persist data) docker run -d \ -p 3000:3000 \ -p 4141:4141 \ -v copilot-data:/root/.local/share/copilot-api \ copilot-go ``` -------------------------------- ### Running Tests Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/picomatch/README.md Instructions to install dependencies and run tests. ```sh npm install && npm test ``` -------------------------------- ### List all compatible versions Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/baseline-browser-mapping/README.md Example of how to list all compatible browser versions, including minimum and subsequent versions. ```javascript getCompatibleVersions({ listAllCompatibleVersions: true, }); ``` -------------------------------- ### Output streams example Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/debug/README.md Example demonstrating how to configure debug output streams. ```javascript var debug = require('debug'); var error = debug('app:error'); // by default stderr is used error('goes to stderr!'); var log = debug('app:log'); // set this namespace to log via console.log log.log = console.log.bind(console); // don't forget to bind to console! log('goes to stdout'); error('still goes to stderr!'); // set all output to go via console.info // overrides all per-namespace log settings debug.log = console.info.bind(console); error('now goes to stdout via console.info'); log('still goes to stdout, but via console.info now'); ``` -------------------------------- ### Importing versions Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/electron-to-chromium/README.md How to import the 'versions' list. ```javascript var versions = require('electron-to-chromium/versions'); ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@types/babel__traverse/README.md Install the @types/babel__traverse package using npm. ```bash npm install --save @types/babel__traverse ``` -------------------------------- ### options.expandRange Example Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/picomatch/README.md Shows how to use a custom `expandRange` function with `fill-range` to create a regex for matching numbered directories. ```javascript const fill = require('fill-range'); const regex = pm.makeRe('foo/{01..25}/bar', { expandRange(a, b) { return `(${fill(a, b, { toRegex: true })})`; } }); console.log(regex); //=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ console.log(regex.test('foo/00/bar')) // false console.log(regex.test('foo/01/bar')) // true console.log(regex.test('foo/10/bar')) // true console.log(regex.test('foo/22/bar')) // true console.log(regex.test('foo/25/bar')) // true console.log(regex.test('foo/26/bar')) // false ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@types/babel__generator/README.md Install the @types/babel__generator package using npm. ```bash npm install --save @types/babel__generator ``` -------------------------------- ### Caret Range Examples Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/semver/README.md Illustrates how caret ranges behave with different version formats, including prereleases and versions with missing patch or minor components. ```text ^1.2.3 := >=1.2.3 <2.0.0 ^0.2.3 := >=0.2.3 <0.3.0 ^0.0.3 := >=0.0.3 <0.0.4 ^1.2.3-beta.2 := >=1.2.3-beta.2 <2.0.0 ^0.0.3-beta := >=0.0.3 <0.0.4 ``` -------------------------------- ### Example Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@jridgewell/remapping/README.md An example demonstrating how to use the `remapping` function with a loader. ```js // Babel transformed "helloworld.js" into "transformed.js" const transformedMap = JSON.stringify({ file: 'transformed.js', // 1st column of 2nd line of output file translates into the 1st source // file, line 3, column 2 mappings: ';CAEE', sources: ['helloworld.js'], version: 3, }); // Uglify minified "transformed.js" into "transformed.min.js" const minifiedTransformedMap = JSON.stringify({ file: 'transformed.min.js', // 0th column of 1st line of output file translates into the 1st source // file, line 2, column 1. mappings: 'AACC', names: [], sources: ['transformed.js'], version: 3, }); const remapped = remapping( minifiedTransformedMap, (file, ctx) => { // The "transformed.js" file is an transformed file. if (file === 'transformed.js') { // The root importer is empty. console.assert(ctx.importer === ''); // The depth in the sourcemap tree we're currently loading. // The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc. console.assert(ctx.depth === 1); return transformedMap; } // Loader will be called to load transformedMap's source file pointers as well. console.assert(file === 'helloworld.js'); // `transformed.js`'s sourcemap points into `helloworld.js`. console.assert(ctx.importer === 'transformed.js'); // This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`. console.assert(ctx.depth === 2); return null; } ); console.log(remapped); // { // file: 'transpiled.min.js', // mappings: 'AAEE', // sources: ['helloworld.js'], // version: 3, // }; ``` -------------------------------- ### Run with Docker Source: https://github.com/starrykira/copilot2api-go/blob/master/README.md Instructions for building a Docker image and running the container with persistent data. ```bash # Build image docker build -t copilot-go . # Run with persistent data docker run -d \ -p 3000:3000 \ -p 4141:4141 \ -v copilot-data:/root/.local/share/copilot-api \ copilot-go ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@jridgewell/resolve-uri/README.md Install the package using npm. ```sh npm install @jridgewell/resolve-uri ``` -------------------------------- ### Building docs Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/picomatch/README.md Instructions to generate the readme using verb. ```sh npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/lru-cache/README.md Install the lru-cache package using npm. ```javascript npm install lru-cache --save ``` -------------------------------- ### Install with npm Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/helper-plugin-utils/README.md Install the @babel/helper-plugin-utils package using npm. ```sh npm install --save @babel/helper-plugin-utils ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@jridgewell/trace-mapping/README.md Install the trace-mapping package using npm. ```shell npm install @jridgewell/trace-mapping ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@jridgewell/sourcemap-codec/README.md Install the sourcemap-codec package using npm. ```bash npm install @jridgewell/sourcemap-codec ``` -------------------------------- ### Install Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/escalade/readme.md Installation command for escalade using npm. ```bash $ npm install --save escalade ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@jridgewell/gen-mapping/README.md Install the gen-mapping package using npm. ```sh npm install @jridgewell/gen-mapping ``` -------------------------------- ### Installation Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@jridgewell/remapping/README.md Install the remapping package using npm. ```sh npm install @jridgewell/remapping ``` -------------------------------- ### options.onMatch Example Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/picomatch/README.md Demonstrates the `onMatch` callback function, which is executed for each successful match. ```javascript const onMatch = ({ glob, regex, input, output }) => { console.log({ glob, regex, input, output }); }; const isMatch = picomatch('*', { onMatch }); isMatch('foo'); isMatch('bar'); isMatch('baz'); ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/parser/README.md Install @babel/parser using yarn. ```sh yarn add @babel/parser --dev ``` -------------------------------- ### Enable POSIX bracket support Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/picomatch/README.md Example showing how to enable POSIX bracket support in picomatch by setting the 'posix' option to true. ```javascript console.log(pm.makeRe('[[:word:]]+', { posix: true })); //=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ ``` -------------------------------- ### Install with yarn Source: https://github.com/starrykira/copilot2api-go/blob/master/web/node_modules/@babel/types/README.md Install @babel/types using yarn. ```sh yarn add @babel/types --dev ```