### Installing shieldbow Library Source: https://github.com/thedrone7/shieldbow/blob/main/README.md Install the main shieldbow library using npm, yarn, or pnpm. Node.JS 16 or higher is recommended for usage. ```npm npm install shieldbow ``` ```yarn yarn add shieldbow ``` ```pnpm pnpm add shieldbow ``` -------------------------------- ### Installing @shieldbow/cache package Source: https://github.com/thedrone7/shieldbow/blob/main/packages/cache/README.md Instructions on how to install the @shieldbow/cache package using different Node.js package managers. This is for users who specifically want to install only the cache component, although using the main shieldbow package is generally recommended. ```Bash $ npm install @shieldbow/cache $ yarn add @shieldbow/cache $ pnpm add @shieldbow/cache ``` -------------------------------- ### Install Shieldbow using yarn Source: https://github.com/thedrone7/shieldbow/blob/main/packages/shieldbow/README.md Installs the shieldbow library using the yarn package manager. This command adds the library as a dependency to your project. ```bash $ yarn add shieldbow ``` -------------------------------- ### Installing @shieldbow/web Client Source: https://github.com/thedrone7/shieldbow/blob/main/README.md Install the @shieldbow/web client for frontend use, along with the optional axios dependency, using npm, yarn, or pnpm. This client is part of the work-in-progress Shieldbow (v3). ```npm npm install @shieldbow/web axios ``` ```yarn yarn add @shieldbow/web axios ``` ```pnpm pnpm add @shieldbow/web axios ``` -------------------------------- ### Installing @shieldbow/ratelimiter Package Source: https://github.com/thedrone7/shieldbow/blob/main/packages/ratelimiter/README.md Instructions on how to install the @shieldbow/ratelimiter package using different Node.js package managers (npm, yarn, pnpm). This package is part of the shieldbow library but can be used standalone. ```bash $ npm install @shieldbow/ratelimiter ``` ```bash $ yarn add @shieldbow/ratelimiter ``` ```bash $ pnpm add @shieldbow/ratelimiter ``` -------------------------------- ### Install Shieldbow using npm Source: https://github.com/thedrone7/shieldbow/blob/main/packages/shieldbow/README.md Installs the shieldbow library using the npm package manager. This command downloads the latest version of the library and its dependencies. ```bash $ npm install shieldbow ``` -------------------------------- ### Install Shieldbow using pnpm Source: https://github.com/thedrone7/shieldbow/blob/main/packages/shieldbow/README.md Installs the shieldbow library using the pnpm package manager. This command adds the library as a dependency, utilizing pnpm's efficient disk space usage. ```bash $ pnpm add shieldbow ``` -------------------------------- ### Installing @shieldbow/web Package (Bash) Source: https://github.com/thedrone7/shieldbow/blob/main/packages/web/README.md These commands demonstrate how to install the @shieldbow/web package using popular Node.js package managers: npm, yarn, and pnpm. Choose the command corresponding to the package manager you use in your project. ```bash $ npm install @shieldbow/web ``` ```bash $ yarn add @shieldbow/web ``` ```bash $ pnpm add @shieldbow/web ``` -------------------------------- ### Install @shieldbow/storage with npm Source: https://github.com/thedrone7/shieldbow/blob/main/packages/storage/README.md Installs the @shieldbow/storage package using the npm package manager. This package provides local file storage capabilities for the shieldbow library. ```bash $ npm install @shieldbow/storage ``` -------------------------------- ### Initializing @shieldbow/web Client with Custom Fetch Method Source: https://github.com/thedrone7/shieldbow/blob/main/README.md Configure the @shieldbow/web client to use a custom HTTP fetch method, such as the browser's native fetch API, by passing it during initialization. This is useful if you don't want to rely on the optional axios dependency. ```TypeScript // Typescript client.initialize({ // ... other options, fetchMethod: (url: string) => fetch(url).then(res => { if (!res.ok) throw new Error(res.statusText); if (res.headers.get('content-type')?.includes('application/json')) return res.json() as Promise; else return res.text() as unknown as Promise; }); }) ``` ```JavaScript // Javascript client.initialize({ // ... other options, fetchMethod: function (url) { return fetch(url).then(res => { if (!res.ok) throw new Error(res.statusText); if (res.headers.get('content-type')?.includes('application/json')) return res.json(); else return res.text(); }); } }) ``` -------------------------------- ### Run Code Formatting and Linting (Shell) Source: https://github.com/thedrone7/shieldbow/blob/main/CONTRIBUTING.md Executes npm scripts to format the code and run linters, ensuring code quality and consistency before committing changes. ```shell $ npm run format && npm run lint ``` -------------------------------- ### Add @shieldbow/storage with pnpm Source: https://github.com/thedrone7/shieldbow/blob/main/packages/storage/README.md Adds the @shieldbow/storage package using the pnpm package manager. This package provides local file storage capabilities for the shieldbow library. ```bash $ pnpm add @shieldbow/storage ``` -------------------------------- ### Add @shieldbow/storage with yarn Source: https://github.com/thedrone7/shieldbow/blob/main/packages/storage/README.md Adds the @shieldbow/storage package using the yarn package manager. This package provides local file storage capabilities for the shieldbow library. ```bash $ yarn add @shieldbow/storage ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.