### Install Chalk Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/chalk/readme.md Install Chalk using npm. This is the initial setup step for using the library. ```bash npm install chalk ``` -------------------------------- ### Render Build and Start Commands Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/github/GoHighLevel-ghl-marketplace-app-template/README.md Configure the build and start commands for deploying the application on Render. The build command installs dependencies and builds the Vue app, while the start command runs the server. ```bash npm install && npm run build ``` ```bash npm start ``` -------------------------------- ### Example API Call to GHL Contacts with Location Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/github/GoHighLevel-ghl-marketplace-app-template/README.md This route demonstrates making a GET request to the GoHighLevel contacts API for a specific location within a company. It checks for installation and retrieves the location token if necessary. ```bash http://localhost:3000/example-api-call-location?companyId=your-company-id&locationId=your-location-id ``` -------------------------------- ### Keyv Initialization and Basic Usage Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/keyv/README.md Demonstrates how to install Keyv, initialize it with different storage adapters, and perform basic set, get, delete, and clear operations. ```APIDOC ## Installation ```bash npm install --save keyv ``` ## Initialization Keyv can be initialized with no arguments (in-memory storage) or with a connection string for various backends. ```javascript const Keyv = require('keyv'); // In-memory storage const keyv = new Keyv(); // With connection strings const keyvRedis = new Keyv('redis://user:pass@localhost:6379'); const keyvMongo = new Keyv('mongodb://user:pass@localhost:27017/dbname'); const keyvSqlite = new Keyv('sqlite://path/to/database.sqlite'); const keyvPostgres = new Keyv('postgresql://user:pass@localhost:5432/dbname'); const keyvMysql = new Keyv('mysql://user:pass@localhost:3306/dbname'); const keyvEtcd = new Keyv('etcd://localhost:2379'); // Handle DB connection errors keyv.on('error', err => console.log('Connection Error', err)); ## Basic Operations Keyv provides a Promise-based API for key-value operations. ```javascript // Set a value with TTL (1 second) await keyv.set('foo', 'expires in 1 second', 1000); // Returns true // Set a value with no expiration await keyv.set('foo', 'never expires'); // Returns true // Get a value await keyv.get('foo'); // Returns 'never expires' // Delete a value await keyv.delete('foo'); // Returns true // Clear all values await keyv.clear(); // Returns undefined ``` ``` -------------------------------- ### Get Invoker File Path in JavaScript Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/get-caller-file/README.md Use the getCallerFile function to retrieve the absolute path of the file that invoked the current function. This example demonstrates a basic setup where a module exports a function that returns the caller's file path. ```javascript // ./foo.js const getCallerFile = require('get-caller-file'); module.exports = function() { return getCallerFile(); // figures out who called it }; ``` ```javascript // index.js const foo = require('./foo'); foo() // => /full/path/to/this/file/index.js ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/CLAUDE.md Starts a local server to preview the generated documentation. Visit http://localhost:8000 in your browser. Also shows an alternative using Python's http.server. ```bash # Serve documentation locally npm run serve # Visit http://localhost:8000 ``` ```bash # Serve docs locally npm run serve python3 -m http.server 8000 --directory docs ``` -------------------------------- ### Basic Optionator Setup and Usage Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/optionator/README.md Demonstrates how to initialize Optionator with custom settings for options and then parse command-line arguments using `parseArgv`. It also shows how to conditionally generate and display help text. ```javascript var optionator = require('optionator')({ prepend: 'Usage: cmd [options]', append: 'Version 1.0.0', options: [{ option: 'help', alias: 'h', type: 'Boolean', description: 'displays help' }, { option: 'count', alias: 'c', type: 'Int', description: 'number of things', example: 'cmd --count 2' }] }); var options = optionator.parseArgv(process.argv); if (options.help) { console.log(optionator.generateHelp()); } ... ``` -------------------------------- ### Get Stream as String Example Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/extract-zip/node_modules/get-stream/readme.md Read a file stream and get its content as a string. This example demonstrates the basic usage of getStream to convert a readable stream to a string. ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream(stream)); /* ,,))))))));, __)))))))))))))), \|/ -\((\((\'\'\'((((((((. -*-==//////((\' . `)))))), /|\ ))| o ;-. \'((((( */* 's been a while since I last saw you, and I'm glad to hear that you're doing well. I'm doing well too, thanks for asking. I've been busy with work, but I'm also trying to make time for my hobbies. I've been learning to play the guitar, and I'm really enjoying it. I've also been trying to get back into shape, so I've been going to the gym a few times a week. I'm also trying to eat healthier, so I've been cooking more at home. I'm looking forward to seeing you again soon. I'll let you know when I'm free. Take care. ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream(stream, { encoding: 'base64' })); })(); ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream(stream, { maxBuffer: 10000 })); })(); ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream.buffer(stream)); })(); ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream.buffer(stream, { maxBuffer: 10000 })); })(); ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt', { objectMode: true }); console.log(await getStream.array(stream)); })(); ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream.array(stream, { encoding: 'buffer' })); })(); ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream.array(stream, { maxBuffer: 10000 })); })(); ``` ```javascript const fs = require('fs'); const getStream = require('get-stream'); (async () => { const stream = fs.createReadStream('unicorn.txt'); console.log(await getStream.array(stream, { encoding: 'utf8', maxBuffer: 10000 })); })(); ``` ```javascript (async () => { try { await getStream(streamThatErrorsAtTheEnd('unicorn')); } catch (error) { console.log(error.bufferedData); //=> 'unicorn' } })() ``` -------------------------------- ### Install and Build Docs for Braces Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/braces/README.md Install global dependencies for documentation generation and then run the build command. ```bash $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Example API Request Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/docs/data/marketplace/community-subpage-documentation.md This is an example of how to make a GET request to the contacts endpoint. ```APIDOC ## GET /contacts/ ### Description Retrieves a list of contacts. ### Method GET ### Endpoint https://services.leadconnectorhq.com/contacts/ ### Parameters #### Query Parameters None explicitly documented. #### Request Body None ### Request Example ```bash curl -X GET \ https://services.leadconnectorhq.com/contacts/ \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **contacts** (array) - A list of contact objects. #### Response Example ```json { "contacts": [ { "id": "contact_id_1", "name": "John Doe", "email": "john.doe@example.com" } ] } ``` ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/github/GoHighLevel-ghl-marketplace-app-template/examples/src/ui/README.md Run this command to install all necessary packages for the project. This is typically the first step after cloning the repository. ```bash npm install ``` -------------------------------- ### Deep Filter Example Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/@nodelib/fs.walk/README.md Provides an example of a deepFilter function to control which directories are read recursively. This example skips directories starting with 'node_modules'. ```typescript // Skip all directories that starts with `node_modules` const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); ``` -------------------------------- ### InstanceType Example Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/globals/node_modules/type-fest/readme.md A basic example demonstrating the usage of InstanceType to get the type of a class instance. ```typescript class IdleService { doNothing (): void {} } class News { title: string; content: string; constructor(title: string, content: string) { this.title = title; this.content = content; } } ``` -------------------------------- ### install() Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/undici/docs/docs/api/GlobalInstallation.md Installs all WHATWG fetch classes globally on `globalThis`. This allows you to use fetch and related classes without explicit imports. ```APIDOC ## install() ### Description Installs all WHATWG fetch classes globally on `globalThis`. ### Method Signature `install()` ### Usage ```js import { install } from 'undici' // Install all WHATWG fetch classes globally install() // Now you can use fetch classes globally without importing const response = await fetch('https://api.example.com/data') const data = await response.json() // All classes are available globally: const headers = new Headers([['content-type', 'application/json']]) const request = new Request('https://example.com') const formData = new FormData() const ws = new WebSocket('wss://example.com') const eventSource = new EventSource('https://example.com/events') ``` ### Installed Classes The `install()` function adds the following classes to `globalThis`: | Class | Description | |-------|-------------| | `fetch` | The fetch function for making HTTP requests | | `Headers` | HTTP headers management | | `Response` | HTTP response representation | | `Request` | HTTP request representation | | `FormData` | Form data handling | | `WebSocket` | WebSocket client | | `CloseEvent` | WebSocket close event | | `ErrorEvent` | WebSocket error event | | `MessageEvent` | WebSocket message event | | `EventSource` | Server-sent events client | ### Notes - The `install()` function overwrites any existing global implementations. - Classes installed are undici's implementations, not Node.js built-ins. - This provides access to undici's latest features and performance improvements. - The global installation persists for the lifetime of the process. ``` -------------------------------- ### Install and Test Braces Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/braces/README.md Install project dependencies and run unit tests to familiarize yourself with the library's API. ```bash $ npm install && npm test ``` -------------------------------- ### Successful Response Example Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/marketplace/integrations-api-subpage-get-all-authorsget.md This is an example of a successful response from the 'Get all authors' API, containing an array of author objects. ```json { "authors": [ { "_id": "lMOzIQZne5m6zQ528sT6", "name": "HighLevel", "locationId": "lMOzIQZne5m6zQ528sT6", "updatedAt": "2025-01-03T11:06:35.822Z", "canonicalLink": "https://tryghl.blog/post/technology" } ] } ``` -------------------------------- ### Quick Start: Connect via SOCKS Proxy Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/socks/README.md Example demonstrating how to connect to a destination host and port through a SOCKS proxy using async/await, promises, or callbacks. ```javascript const options = { proxy: { host: '159.203.75.200', port: 1080, type: 5 }, command: 'connect', destination: { host: '192.30.253.113', port: 80 } }; // Async/Await try { const info = await SocksClient.createConnection(options); console.log(info.socket); } catch (err) { // Handle errors } ``` ```javascript SocksClient.createConnection(options) .then(info => { console.log(info.socket); }) .catch(err => { // Handle errors }); ``` ```javascript SocksClient.createConnection(options, (err, info) => { if (!err) { console.log(info.socket); } else { // Handle errors } }); ``` -------------------------------- ### Example API Request Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/marketplace/community-subpage-documentation.md This example demonstrates how to make a GET request to the contacts endpoint using an authorization token. ```APIDOC ## GET /contacts/ ### Description Retrieves a list of contacts. ### Method GET ### Endpoint https://services.leadconnectorhq.com/contacts/ ### Parameters #### Query Parameters None specified. #### Request Body None. ### Request Example ```bash curl -X GET \ https://services.leadconnectorhq.com/contacts/ \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **contacts** (array) - A list of contact objects. #### Response Example ```json { "contacts": [ { "id": "contact_id_1", "name": "John Doe", "email": "john.doe@example.com" } ] } ``` ``` -------------------------------- ### Install asynckit Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/asynckit/README.md Install the asynckit library using npm. ```sh npm install --save asynckit ``` -------------------------------- ### Install tslib with JSPM Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/tslib/README.md Install the tslib library using JSPM. Choose the version that aligns with your TypeScript setup. ```sh # TypeScript 3.9.2 or later jspm install tslib # TypeScript 3.8.4 or earlier jspm install tslib@^1 # TypeScript 2.3.2 or earlier jspm install tslib@1.6.1 ``` -------------------------------- ### Example API Request Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/marketplace/api-section-2021-04-15.md This is an example of a GET request to the contacts endpoint. Ensure you replace 'YOUR_TOKEN' with your actual API token. ```curl curl -X GET \ https://services.leadconnectorhq.com/contacts/ \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Clone, Install, and Test iconv-lite Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/iconv-lite/README.md Instructions for cloning the repository, installing dependencies, and running tests for iconv-lite. Includes commands for performance and coverage analysis. ```bash git clone git@github.com:ashtuchkin/iconv-lite.git cd iconv-lite npm install npm test ``` ```bash # To view performance: node test/performance.js ``` ```bash # To view test coverage: npm run coverage open coverage/lcov-report/index.html ``` -------------------------------- ### Show CLI Help Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/@puppeteer/browsers/README.md Use npx to run the CLI and display help information for all commands. ```bash npx @puppeteer/browsers --help ``` -------------------------------- ### Example API Request Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/marketplace/developer-portal-subpage-documentation.md This example demonstrates how to make a GET request to the contacts endpoint using an authorization token and specifying the content type. ```APIDOC ## Example API Request ```bash curl -X GET \ https://services.leadconnectorhq.com/contacts/ \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" ``` ``` -------------------------------- ### Navigate to Project Root and Start Server Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/github/GoHighLevel-ghl-marketplace-app-template/README.md Return to the project's root directory and start the Express server. This command initiates both the API and serves the Vue application. ```bash cd ../.. npm start ``` -------------------------------- ### Show Specific CLI Command Help Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/@puppeteer/browsers/README.md Display help for specific commands like 'install' or 'launch' using npx. ```bash npx @puppeteer/browsers install --help ``` ```bash npx @puppeteer/browsers launch --help ``` -------------------------------- ### Example API Request Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/content/marketplace/developer-portal-subpage-api-2-0-docs.md This example demonstrates how to make a GET request to the contacts endpoint using an authorization token and specifying the content type. ```APIDOC ## GET Contacts ### Description Retrieves a list of contacts. ### Method GET ### Endpoint https://services.leadconnectorhq.com/contacts/ ### Parameters #### Headers - **Authorization** (string) - Required - Bearer YOUR_TOKEN - **Content-Type** (string) - Required - application/json ### Request Example ```bash curl -X GET \ https://services.leadconnectorhq.com/contacts/ \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **contacts** (array) - A list of contact objects. #### Response Example ```json { "contacts": [ { "id": "contact_id_1", "name": "John Doe", "email": "john.doe@example.com" } ] } ``` ``` -------------------------------- ### Basic Puppeteer Usage Example Source: https://github.com/launch-maniac/ghl-complete-docs/blob/main/node_modules/puppeteer/README.md This example demonstrates launching a browser, navigating to a page, searching for text, clicking a result, and extracting content. Ensure you have Puppeteer installed. ```typescript import puppeteer from 'puppeteer'; (async () => { // Launch the browser and open a new blank page const browser = await puppeteer.launch(); const page = await browser.newPage(); // Navigate the page to a URL await page.goto('https://developer.chrome.com/'); // Set screen size await page.setViewport({width: 1080, height: 1024}); // Type into search box await page.type('.devsite-search-field', 'automate beyond recorder'); // Wait and click on first result const searchResultSelector = '.devsite-result-item-link'; await page.waitForSelector(searchResultSelector); await page.click(searchResultSelector); // Locate the full title with a unique string const textSelector = await page.waitForSelector( 'text/Customize and automate' ); const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title console.log('The title of this blog post is "%s".', fullTitle); await browser.close(); })(); ```