Documentation
Installation

Installation

Welcome to the Sec5 installation guide! This document equips you with step-by-step instructions for seamlessly integrating Sec5 into your development workflow. By installing Sec5, you empower your development process with advanced security and code quality checks, fostering a robust and well-maintained codebase.

Prerequisites

To ensure a smooth installation process, kindly verify that your development environment meets the following requirements:

  • JavaScript Runtime: A JavaScript runtime environment compatible with Node.js: https://nodejs.org/ (opens in a new tab) and supporting features like ES2022 and dynamic imports.
  • Package Manager: A JavaScript package manager to manage dependencies effectively. Common options include npm (Node Package Manager) or pnpm (a performant alternative).
  • Internet Connection: An active internet connection is necessary for downloading the Sec5 package.

Recommended Installation Method: pnpm

For optimal performance and efficiency, we highly recommend installing Sec5 using pnpm. This package manager offers several advantages:

  • Speed: pnpm boasts exceptional installation speeds, minimizing wait times.
  • Efficiency: It manages dependencies effectively, ensuring smooth project operation.
  • Node.js Compatibility: pnpm seamlessly integrates with Node.js environments.

Global Installation (for all projects):

Step 1

Open your terminal or command prompt.

Step 2

Execute the following command:

pnpm add -g sec5

Project-Specific Installation:

If you prefer to install Sec5 solely for the current project, use this command:

pnpm add -D sec5

This approach installs Sec5 as a development dependency, making it readily available within your project but not globally accessible.

Integrating Sec5 into Your Workflow

To ensure your project undergoes Sec5 checks before the build process, add a custom script to your package.json file:

Step 1

Locate and open your project's package.json file.

Step 2

Within the scripts section, add the following script:

package.json
"scripts": {
  "dev": "next dev",
  "build": "sec5 && next build",
  "start": "next start",
  "lint": "next lint",
  "check": "sec5"
}

This script incorporates Sec5 into the build process. The sec5 command executes Sec5 checks, and the && operator ensures that the subsequent next build command only runs if Sec5 completes successfully. If any errors are detected during Sec5's analysis, the build process will be halted, preventing the creation of a potentially flawed build. This approach allows for early detection and resolution of issues, contributing to a more secure and efficient development lifecycle.

Next Steps

With the installation and integration complete, you're well-positioned to leverage Sec5's capabilities. To customize Sec5's behavior and tailor it to your project's specific needs, we recommend configuring it further. Head over to the dedicated Configuration Guide for detailed instructions:


By following these steps and exploring the configuration options, you can maximize Sec5's value in ensuring a high-quality and secure development process.