### npm Scripts for Node.js Project Management Source: https://context7.com/sourcecraft/template-node-js.git/llms.txt Common npm scripts used for managing Node.js projects, including installing dependencies, running tests, and building the project. These are typically defined in the 'package.json' file. ```bash # Run tests npm test # Output: "test passed" # Install dependencies (for CI) npm ci # Run build (if defined) npm run build --if-present ``` -------------------------------- ### Node.js Hello World Function and Express Integration Source: https://context7.com/sourcecraft/template-node-js.git/llms.txt Demonstrates a basic Node.js function that returns a greeting message and its integration into a simple Express.js application. It requires the 'express' package. ```javascript // Import module const helloNpm = require('./index'); // Call function const message = helloNpm(); console.log(message); // Output: "Hello SourceCraft CI/CD" // Usage in Express application const express = require('express'); const app = express(); app.get('/', (req, res) => { res.send(helloNpm()); }); app.listen(3000); ``` -------------------------------- ### SourceCraft CI/CD Configuration for Node.js Projects Source: https://context7.com/sourcecraft/template-node-js.git/llms.txt Defines the workflow for automated building and testing of a Node.js project upon push events to main branches. It uses a Docker image for Node.js LTS and specifies build and test commands. ```yaml # Trigger on push on: push: - workflows: build-workflow filter: branches: ["master", "main"] # Define workflow workflows: build-workflow: tasks: - build-task # Build tasks tasks: - name: build-task cubes: - name: build-npm image: cr.yandex/mirror/library/node:lts script: - npm ci # Install dependencies - npm run build --if-present # Build (if script exists) - npm test # Run tests ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.