[
  {
    "path": ".editorconfig",
    "content": "# https://EditorConfig.org\n\n# top-most EditorConfig file\nroot=true\n\n# Unix-style newlines with a newline ending every file\n[*]\nend_of_line = lf\ninsert_final_newline = true\n\n# 2 space indentation\nindent_style = space\nindent_size = 2\n\n# Avoid issues parsing cookbook files later\ncharset = utf-8\n\n# Avoid cookstyle warnings\ntrim_trailing_whitespace = true\n"
  },
  {
    "path": ".envrc",
    "content": "use chefworkstation\nexport KITCHEN_GLOBAL_YAML=kitchen.global.yml\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto eol=lf\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "* @sous-chefs/maintainers\n"
  },
  {
    "path": ".github/copilot-instructions.md",
    "content": "# Copilot Instructions for Sous Chefs Cookbooks\n\n## Repository Overview\n\n**Chef cookbook** for managing software installation and configuration. Part of the Sous Chefs cookbook ecosystem.\n\n**Key Facts:** Ruby-based, Chef >= 16 required, supports various OS platforms (check metadata.rb, kitchen.yml and .github/workflows/ci.yml for which platforms to specifically test)\n\n## Project Structure\n\n**Critical Paths:**\n- `recipes/` - Chef recipes for cookbook functionality (if this is a recipe-driven cookbook)\n- `resources/` - Custom Chef resources with properties and actions (if this is a resource-driven cookbook)\n- `spec/` - ChefSpec unit tests\n- `test/integration/` - InSpec integration tests (tests all platforms supported)\n- `test/cookbooks/` or `test/fixtures/` - Example cookbooks used during testing that show good examples of custom resource usage\n- `attributes/` - Configuration for recipe driven cookbooks (not applicable to resource cookbooks)\n- `libraries/` - Library helpers to assist with the cookbook. May contain multiple files depending on complexity of the cookbook.\n- `templates/` - ERB templates that may be used in the cookbook\n- `files/` - files that may be used in the cookbook\n- `metadata.rb`, `Berksfile` - Cookbook metadata and dependencies\n\n## Build and Test System\n\n### Environment Setup\n**MANDATORY:** Install Chef Workstation first - provides chef, berks, cookstyle, kitchen tools.\n\n### Essential Commands (strict order)\n```bash\nberks install                   # Install dependencies (always first)\ncookstyle                       # Ruby/Chef linting\nyamllint .                      # YAML linting\nmarkdownlint-cli2 '**/*.md'     # Markdown linting\nchef exec rspec                 # Unit tests (ChefSpec)\n# Integration tests will be done via the ci.yml action. Do not run these. Only check the action logs for issues after CI is done running.\n```\n\n### Critical Testing Details\n- **Kitchen Matrix:** Multiple OS platforms × software versions (check kitchen.yml for specific combinations)\n- **Docker Required:** Integration tests use Dokken driver\n- **CI Environment:** Set `CHEF_LICENSE=accept-no-persist`\n- **Full CI Runtime:** 30+ minutes for complete matrix\n\n### Common Issues and Solutions\n- **Always run `berks install` first** - most failures are dependency-related\n- **Docker must be running** for kitchen tests\n- **Chef Workstation required** - no workarounds, no alternatives\n- **Test data bags needed** (optional for some cookbooks) in `test/integration/data_bags/` for convergence\n\n## Development Workflow\n\n### Making Changes\n1. Edit recipes/resources/attributes/templates/libraries\n2. Update corresponding ChefSpec tests in `spec/`\n3. Also update any InSpec tests under test/integration\n4. Ensure cookstyle and rspec passes at least. You may run `cookstyle -a` to automatically fix issues if needed.\n5. Also always update all documentation found in README.md and any files under documentation/*\n6. **Always update CHANGELOG.md** (required by Dangerfile) - Make sure this conforms with the Sous Chefs changelog standards.\n\n### Pull Request Requirements\n- **PR description >10 chars** (Danger enforced)\n- **CHANGELOG.md entry** for all code changes\n- **Version labels** (major/minor/patch) required\n- **All linters must pass** (cookstyle, yamllint, markdownlint)\n- **Test updates** needed for code changes >5 lines and parameter changes that affect the code logic\n\n## Chef Cookbook Patterns\n\n### Resource Development\n- Custom resources in `resources/` with properties and actions\n- Include comprehensive ChefSpec tests for all actions\n- Follow Chef resource DSL patterns\n\n### Recipe Conventions\n- Use `include_recipe` for modularity\n- Handle platforms with `platform_family?` conditionals\n- Use encrypted data bags for secrets (passwords, SSL certs)\n- Leverage attributes for configuration with defaults\n\n### Testing Approach\n- **ChefSpec (Unit):** Mock dependencies, test recipe logic in `spec/`\n- **InSpec (Integration):** Verify actual system state in `test/integration/inspec/` - InSpec files should contain proper inspec.yml and controls directories so that it could be used by other suites more easily.\n- One test file per recipe, use standard Chef testing patterns\n\n## Trust These Instructions\n\nThese instructions are validated for Sous Chefs cookbooks. **Do not search for build instructions** unless information here fails.\n\n**Error Resolution Checklist:**\n1. Verify Chef Workstation installation\n2. Confirm `berks install` completed successfully\n3. Ensure Docker is running for integration tests\n4. Check for missing test data dependencies\n\nThe CI system uses these exact commands - following them matches CI behavior precisely.\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "---\nname: ci\n\n\"on\":\n  pull_request:\n  push:\n    branches: [main]\n\njobs:\n  lint-unit:\n    uses: sous-chefs/.github/.github/workflows/lint-unit.yml@6.0.0\n    permissions:\n      actions: write\n      checks: write\n      pull-requests: write\n      statuses: write\n      issues: write\n\n  integration:\n    needs: lint-unit\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        os:\n          - \"almalinux-9\"\n          - \"rockylinux-9\"\n          - \"amazonlinux-2023\"\n          - \"centos-stream-9\"\n          - \"centos-stream-10\"\n          - \"debian-11\"\n          - \"debian-12\"\n          - \"ubuntu-2204\"\n          - \"ubuntu-2404\"\n        suite:\n          - \"default\"\n          - \"npm-embedded\"\n          - \"package\"\n          - \"source\"\n        exclude:\n          - os: \"amazonlinux-2023\"\n            suite: \"source\"\n          - os: \"fedora-latest\"\n            suite: \"source\"\n      fail-fast: false\n\n    steps:\n      - name: Check out code\n        uses: actions/checkout@v6\n      - name: Install Chef\n        uses: actionshub/chef-install@6.0.0\n      - name: Dokken\n        uses: actionshub/test-kitchen@3.0.0\n        env:\n          CHEF_LICENSE: accept-no-persist\n          KITCHEN_LOCAL_YAML: kitchen.dokken.yml\n        with:\n          suite: ${{ matrix.suite }}\n          os: ${{ matrix.os }}\n\n  success:\n    if: ${{ always() }}\n    needs: [\"integration\"]\n    name: Integration Successful\n    runs-on: ubuntu-latest\n    steps:\n      - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}\n        name: Check matrix status\n        run: exit 1\n"
  },
  {
    "path": ".github/workflows/conventional-commits.yml",
    "content": "---\nname: conventional-commits\n\n\"on\":\n  pull_request:\n    types:\n      - opened\n      - reopened\n      - edited\n      - synchronize\n\njobs:\n  conventional-commits:\n    uses: sous-chefs/.github/.github/workflows/conventional-commits.yml@6.0.0\n"
  },
  {
    "path": ".github/workflows/copilot-setup-steps.yml",
    "content": "---\nname: 'Copilot Setup Steps'\n\n\"on\":\n  workflow_dispatch:\n  push:\n    paths:\n      - .github/workflows/copilot-setup-steps.yml\n  pull_request:\n    paths:\n      - .github/workflows/copilot-setup-steps.yml\n\njobs:\n  copilot-setup-steps:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n    steps:\n      - name: Check out code\n        uses: actions/checkout@v6\n      - name: Install Chef\n        uses: actionshub/chef-install@main\n      - name: Install cookbooks\n        run: berks install\n"
  },
  {
    "path": ".github/workflows/prevent-file-change.yml",
    "content": "---\nname: prevent-file-change\n\n\"on\":\n  pull_request:\n    types:\n      - opened\n      - reopened\n      - edited\n      - synchronize\n\njobs:\n  prevent-file-change:\n    uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@6.0.0\n    secrets:\n      token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "---\nname: release\n\n\"on\":\n  push:\n    branches:\n      - main\n\npermissions:\n  contents: write\n  issues: write\n  pull-requests: write\n  packages: write\n  attestations: write\n  id-token: write\n\njobs:\n  release:\n    uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@6.0.0\n    secrets:\n      token: ${{ secrets.PORTER_GITHUB_TOKEN }}\n      supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}\n      supermarket_key: ${{ secrets.CHEF_SUPERMARKET_KEY }}\n"
  },
  {
    "path": ".github/workflows/stale.yml",
    "content": "---\nname: Mark stale issues and pull requests\n\n\"on\":\n  schedule: [cron: \"0 0 * * *\"]\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/stale@v10\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          close-issue-message: >\n            Closing due to inactivity.\n            If this is still an issue please reopen or open another issue.\n            Alternatively drop by the #sous-chefs channel on the [Chef Community Slack](http://community-slack.chef.io/) and we'll be happy to help!\n            Thanks, Sous-Chefs.\n          days-before-close: 7\n          days-before-stale: 365\n          stale-issue-message: >\n            Marking stale due to inactivity.\n            Remove stale label or comment or this will be closed in 7 days.\n            Alternatively drop by the #sous-chefs channel on the [Chef Community Slack](http://community-slack.chef.io/) and we'll be happy to help!\n            Thanks, Sous-Chefs.\n"
  },
  {
    "path": ".gitignore",
    "content": "*.rbc\n.config\nInstalledFiles\npkg\ntest/tmp\ntest/version_tmp\ntmp\n_Store\n*~\n*#\n.#*\n\\#*#\n*.un~\n*.tmp\n*.bk\n*.bkup\n\n# editor files\n.idea\n.*.sw[a-z]\n\n# ruby/bundler/rspec files\n.ruby-version\n.ruby-gemset\n.rvmrc\nGemfile.lock\n.bundle\n*.gem\ncoverage\nspec/reports\n\n# YARD / rdoc artifacts\n.yardoc\n_yardoc\ndoc/\nrdoc\n\n# chef infra stuff\nBerksfile.lock\n.kitchen\nkitchen.local.yml\nvendor/\n.coverage/\n.zero-knife.rb\nPolicyfile.lock.json\n\n# vagrant stuff\n.vagrant/\n.vagrant.d/\n"
  },
  {
    "path": ".markdownlint-cli2.yaml",
    "content": "config:\n  ul-indent: false # MD007\n  line-length: false # MD013\n  no-duplicate-heading: false # MD024\n  reference-links-images: false # MD052\n  no-multiple-blanks:\n    maximum: 2\nignores:\n  - .github/copilot-instructions.md\n"
  },
  {
    "path": ".mdlrc",
    "content": "rules \"~MD013\"\n"
  },
  {
    "path": ".overcommit.yml",
    "content": "---\nPreCommit:\n  TrailingWhitespace:\n    enabled: true\n  YamlLint:\n    enabled: true\n    required_executable: \"yamllint\"\n  ChefSpec:\n    enabled: true\n    required_executable: \"chef\"\n    command: [\"chef\", \"exec\", \"rspec\"]\n  Cookstyle:\n    enabled: true\n    required_executable: \"cookstyle\"\n    command: [\"cookstyle\"]\n  MarkdownLint:\n    enabled: false\n    required_executable: \"npx\"\n    command: [\"npx\", \"markdownlint-cli2\", \"'**/*.md'\"]\n    include: [\"**/*.md\"]\n\nCommitMsg:\n  HardTabs:\n    enabled: true\n"
  },
  {
    "path": ".release-please-manifest.json",
    "content": "{\n  \".\": \"10.2.3\"\n}\n"
  },
  {
    "path": ".rubocop.yml",
    "content": "require:\n  - cookstyle\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\n    \"chef-software.chef\",\n    \"Shopify.ruby-lsp\",\n    \"editorconfig.editorconfig\",\n    \"DavidAnson.vscode-markdownlint\"\n  ]\n}\n"
  },
  {
    "path": ".yamllint",
    "content": "---\nextends: default\nrules:\n  line-length:\n    max: 256\n    level: warning\n  document-start: disable\n  braces:\n    forbid: false\n    min-spaces-inside: 0\n    max-spaces-inside: 1\n    min-spaces-inside-empty: -1\n    max-spaces-inside-empty: -1\n  comments:\n    min-spaces-from-content: 1\n"
  },
  {
    "path": "Berksfile",
    "content": "source 'https://supermarket.chef.io'\n\nmetadata\n\ngroup :integration do\n  cookbook 'test', path: './test/cookbooks/test'\nend\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# NodeJS Cookbook Changelog\n\nStandardise files with files in sous-chefs/repo-management\nStandardise files with files in sous-chefs/repo-management\nStandardise files with files in sous-chefs/repo-management\n\n## [10.2.3](https://github.com/sous-chefs/nodejs/compare/10.2.2...v10.2.3) (2025-10-15)\n\n\n### Bug Fixes\n\n* **ci:** Update workflows to use release pipeline ([#300](https://github.com/sous-chefs/nodejs/issues/300)) ([ef16e2c](https://github.com/sous-chefs/nodejs/commit/ef16e2ce7d32be9d50822926a8d09e30d4a54bad))\n\n## 10.2.1 - *2025-06-08*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.2.0 - *2024-11-20*\n\n* Add support for new NodeSource repository (Thanks to @stissot)\n* Rework source install packages\n* Update SUSE packages\n\n## 10.1.22 - *2024-11-19*\n\n* Update default version to current LTS\n\n## 10.1.21 - *2024-11-19*\n\n* Update CI platforms\n\n## 10.1.20 - *2024-11-18*\n\n* Update test matrix check success of the integration stage\n\n## 10.1.19 - *2024-11-18*\n\nStandardise files with files in sous-chefs/repo-management\n\nStandardise files with files in sous-chefs/repo-management\n\nStandardise files with files in sous-chefs/repo-management\n\nStandardise files with files in sous-chefs/repo-management\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.16 - *2024-05-03*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.10 - *2023-04-07*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.7 - *2023-04-01*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.6 - *2023-03-20*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.5 - *2023-03-15*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.4 - *2023-02-20*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.2 - *2023-02-14*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.1 - *2022-12-08*\n\nStandardise files with files in sous-chefs/repo-management\n\n## 10.1.0 - *2022-08-08*\n\n* To ensure consistent environment between `npm install` and `npm list`, pass same environment variables.\n\n## 10.0.1 - *2022-08-07*\n\n* Standardise files with files in sous-chefs/repo-management\n* Default to using EL 9 repo for Fedora\n* CI: Remove Fedora from source suite\n\n## 10.0.0 - *2022-04-21*\n\n* Update to NodeJS 17.x\n* Remove delivery and move to calling RSpec directly via a reusable workflow\n* Update tested platforms\n* Disable upstream DNF module on EL8 based systems\n\n## 9.0.2 - *2022-02-17*\n\n* Standardise files with files in sous-chefs/repo-management\n\n## 9.0.1 - *2022-02-08*\n\n* Remove delivery folder\n\n## 9.0.0 - *2021-09-13*\n\n* Update the default version to 14 LTS\n* Remove testing for EOL platforms\n* Add Debian 11 testing\n* Fix release version to use for Amazon Linux\n\n## 8.0.0 - *2021-09-02*\n\n* Update metadata and README to Sous Chef\n* Enable unified_mode by default and require at least Chef Infra Client 15.3\n* Cookstyle fixes\n\n## 7.3.3 - *2021-08-30*\n\n* Standardise files with files in sous-chefs/repo-management\n\n## 7.3.2 - *2021-06-01*\n\n* Standardise files with files in sous-chefs/repo-management\n\n## 7.3.1 - *2020-12-31*\n\n* resolved cookstyle error: attributes/packages.rb:15:55 convention: `Layout/TrailingEmptyLines`\n* resolved cookstyle error: test/cookbooks/test/recipes/resource.rb:118:1 convention: `Layout/TrailingEmptyLines`\n* Enable builds for opensuse-leap-15\n* Add a library method test\n\n## 7.3.0 (2020-10-21)\n\n* Add rspec tests for the library methods\n* Update the url_invalid? method to return false if it detects an invalid uri\n* Add the auto_update option to the npm_package resource. Allows turning off auto_update of npm packages.\n* Allow actions and options for OS package installation to be specified as attributes\n* Add the live_stream parameter to the npm_package execution to get better installation diagnostics\n* Add the auto_update option to the npm_package resource. Allows turning off auto_update of npm packages.\n* Update testing\n\n## 7.2.0 (2020-10-07)\n\n* Verify the URI of installed packages to help determine if a good URI has been installed\n* Add tests that verify npm-package installed packages\n* Get the example test cookbook working\n* Add support for installing node on windows\n\n## 7.1.0 (2020-10-01)\n\n* resolved cookstyle error: recipes/nodejs_from_binary.rb:19:1 refactor: `ChefCorrectness/IncorrectLibraryInjection`\n* resolved cookstyle error: recipes/nodejs_from_source.rb:21:1 refactor: `ChefCorrectness/IncorrectLibraryInjection`\n* resolved cookstyle error: recipes/npm_from_source.rb:21:1 refactor: `ChefCorrectness/IncorrectLibraryInjection`\n* Have ark setup node and npm binaries into PATH\n* Add `node_env` to `npm_package` in order to set `NODE_ENV` (useful for some packages)\n* Include `npx` as a binary in addition to `npm`, it has been [included since `npm` v5.2.0](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b)\n\n## 7.0.1 (2020-06-04)\n\n* Minor readme fix\n\n## 7.0.0 (2020-06-04)\n\n* Require Chef Infra Client 14+ and remove the build-essential dependency\n* Updated the default to Node.js v10.16.3\n* Added compatibility with Chef Infra Client 16.2+\n* Removed Foodcritic testing\n* Updated ChefSpec and Kitchen platforms\n* Resolved multiple minor cookstyle issues in the cookbook\n* Added a vscode editor config\n\n## 6.0.0 (2018-10-11)\n\n* Use the build_essential resource in the source install recipe instead of the build-essential::default recipe. This way we can use the new built-in build_essential resource in Chef 14+\n* Set default version to Node.js v8.12.0\n\n## 5.0.0 (2017-11-15)\n\n* nodejs_npm resource has been converted to a custom resource and renamed to npm_package. The existing resource name will continue to function, but over time code should be updated for the new name. This name change has been made so we can eventually merge this resource into the chef-client.\n* compat_resource cookbook dependency has been removed and this cookbook instead requires Chef 12.14 or later\n* Chef 13 compatibility has been resolved\n* The npm_package resource now properly installs packages when the 'package' property is setA\n* Speed up npm operations by only returning a list of the desired package instead of every npm package\n* Speed up source installation by using multipackage install for the dependencies\n* Remove the broken url_valid? helper which didn't work\n\n## 4.0.0 (2017-07-11)\n\n* Updated the cookbook to require Chef 12.1+ and the compat_resource cookbook\n* Removed support for io.js which has merged back into the node.js project\n* Removed the dependency on homebrew, yum-epel, and apt cookbooks\n* Added node['nodejs']['manage_node'] attribute to use only cookbook's LWRP (required to manage node by nvm)\n* Updated the default repository URLs to be the 6.X repos\n* Added initial support for Suse and Amazon Linux\n* Improved architecture detection to support aarch64\n* Improved readme with examples for fetching your own binaries\n* Added installation of openssl and xz utilities that are needed for the binary install recipe\n* Updated the cookbook license string to be an SPDX compliant string\n* Set the minimum version of the ark cookbook to 2.0.2 in order to support Suse\n* Updated the default version from 6.9.1 to 6.10.2\n* Switched to Delivery local mode for testing\n* Added Integration testing in Travis CI with kitchen-dokken and ChefDK\n\n## 3.0.0 (2016-11-02)\n\n* Updated the default release to the nodejs 6.9.1\\. This requires C++11 extensions to compile, which are only present in GCC 4.8+. Due to this RHEL 5/6 and Ubuntu 12.04 are not supported if using this version.\n* Switched the download URLs to the .xz packages since the .tar.gz packages are no longer being created\n* Improvements to the readme examples and requirements sections\n* Removed installation of apt-transport-https and instead rely on an apt cookbook that will do the same\n* Fixed the ChefSpec matchers\n* Added Scientific, Oracle, and Amazon as supported distros in the metadata\n* Added chef_version metadata\n* Removed conflicts and suggests metadata which aren't implemented or recommended for use\n* Removed Chef 10 compatibility code\n* Switched Integration testing to Inspec from bats\n* Added the Apache 2.0 license file to the repo\n* Expanded Test Kitchen testing\n* Switched from Rubocop to Cookstyle and resolved all warnings\n* Switched Travis to testing using ChefDK\n\n## 2.4.4\n\n* Use HTTPS prefix URLs for node download #98\n* Update NPM symlink when installing from source #105\n* Add support for NPM private modules #107\n\n## v2.4.2\n\n* Fix check version\n* Support iojs package install\n\n## v2.4.0\n\n* Move `npm_packages` to his own recipe\n* Fix different race conditions when using direct recipe call\n* Fix npm recipe\n\n## v2.3.2\n\n* Fix package recipe\n\n## v2.3.0\n\n* Support io.js. Use node['nodejs']['engine'].\n* Add MacOS support via homebrew\n\n## v2.2.0\n\n* Add node['nodejs']['keyserver']\n* Update arm checksum\n* Fix `npm_packages` JSON\n\n## v2.1.0\n\n* Use official nodesource repository\n* Add node['nodejs']['npm_packages'] to install npm package with `default` recipe\n\n## v2.0.0\n\n* Travis integration\n* Gems updated\n* Rewrite cookbook dependencies\n* Added complete test-kitchen integration : Rake, rubocop, foodcritic, vagrant, bats testing ...\n* Added NodeJS `install_method` option (sources, bins or packages)\n* Added NPM `install_method` option (sources or packages)\n* NPM version can now be chosen independently from nodejs' embedded version\n* Added a `nodejs_npm` LWRP to manage, install and resolve NPM packages\n\n## v1.3.0\n\n* update default versions to the latest: node - v0.10.15 and npm - v1.3.5\n* default to package installation of nodejs on smartos ([@wanelo-pair])\n* Add Raspberry pi support ([@robertkowalski])\n\n## v1.2.0\n\n* implement installation from package on RedHat - ([@vaskas])\n\n## v1.1.3\n\n* update default version of node to 0.10.13 - and npm - v1.3.4 ([@jodosha][])\n\n## v1.1.2\n\n* update default version of node to 0.10.2 - ([@bakins])\n* fully migrated to test-kitchen 1.alpha and vagrant 1.1.x/berkshelf 1.3.1\n\n## v1.1.1\n\n* update default versions to the latest: node - v0.10.0 and npm - v1.2.14\n* `make_thread` is now a real attribute - ([@ChrisLundquist])\n\n## v1.1.0\n\n* rewrite the package install; remove rpm support since there are no longer any packages available anywhere\n* add support to install `legacy_packages` from ubuntu repo as well as the latest 0.10.x branch (this is default).\n\n## v1.0.4\n\n* add support for binary installation method ([@JulesAU])\n\n## v1.0.3\n\n* 7.3.1 - *2020-12-31*\n\n## v1.0.2\n\n* add smartos support for package install ([@sax])\n* support to compile with all processors available (default 2 if unknown) - ([@ChrisLundquist])\n* moved to `platform_family` syntax\n* ensure npm recipe honours the 'source' or 'package' setting - ([@markbirbeck])\n* updated the default versions to the latest stable node/npm\n\n## v1.0.1\n\n* fixed bug that prevented overwritting the node/npm versions (moved the `src_url`s as local variables instead of attributes) - ([@johannesbecker])\n* updated the default versions to the latest node/npm\n\n## v1.0.0\n\n* added packages installation support ([@smith])\n\n[@bakins]: https://github.com/bakins\n[@chrislundquist]: https://github.com/ChrisLundquist\n[@johannesbecker]: https://github.com/johannesbecker\n[@julesau]: https://github.com/JulesAU\n[@markbirbeck]: https://github.com/markbirbeck\n[@robertkowalski]: https://github.com/robertkowalski\n[@sax]: https://github.com/sax\n[@smith]: https://github.com/smith\n[@vaskas]: https://github.com/vaskas\n[@wanelo-pair]: https://github.com/wanelo-pair\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Community Guidelines\n\nThis project follows the Chef Community Guidelines <https://docs.chef.io/community_guidelines.html>\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nPlease refer to\n[https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD)\n"
  },
  {
    "path": "Dangerfile",
    "content": "# Reference: http://danger.systems/reference.html\n\n# A pull request summary is required. Add a description of the pull request purpose.\n# Changelog must be updated for each pull request that changes code.\n# Warnings will be issued for:\n#    Pull request with more than 400 lines of code changed\n#    Pull reqest that change more than 5 lines without test changes\n# Failures will be issued for:\n#    Pull request without summary\n#    Pull requests with code changes without changelog entry\n\ndef code_changes?\n  code = %w(libraries attributes recipes resources files templates)\n  code.each do |location|\n    return true unless git.modified_files.grep(/#{location}/).empty?\n  end\n  false\nend\n\ndef test_changes?\n  tests = %w(spec test kitchen.yml kitchen.dokken.yml)\n  tests.each do |location|\n    return true unless git.modified_files.grep(/#{location}/).empty?\n  end\n  false\nend\n\nfailure 'Please provide a summary of your Pull Request.' if github.pr_body.length < 10\n\nwarn 'This is a big Pull Request.' if git.lines_of_code > 400\n\nwarn 'This is a Table Flip.' if git.lines_of_code > 2000\n\n# Require a CHANGELOG entry for non-test changes.\nif !git.modified_files.include?('CHANGELOG.md') && code_changes?\n  failure 'Please include a CHANGELOG entry.'\nend\n\n# Require Major Minor Patch version labels\nunless github.pr_labels.grep /minor|major|patch/i\n  warn 'Please add a release label to this pull request'\nend\n\n# A sanity check for tests.\nif git.lines_of_code > 5 && code_changes? && !test_changes?\n  warn 'This Pull Request is probably missing tests.'\nend\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "README.md",
    "content": "# [nodejs-cookbook](https://github.com/redguide/nodejs)\n\n[![Cookbook Version](https://img.shields.io/cookbook/v/nodejs.svg)](https://supermarket.chef.io/cookbooks/nodejs)\n[![CI State](https://github.com/sous-chefs/nodejs/workflows/ci/badge.svg)](https://github.com/sous-chefs/nodejs/actions?query=workflow%3Aci)\n[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)\n[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)\n[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n\nInstalls node.js/npm and includes a resource for managing npm packages\n\n## Maintainers\n\nThis cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit [sous-chefs.org](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF).\n\n## Requirements\n\n### Platforms\n\n- Debian/Ubuntu\n- RHEL/CentOS/Scientific/Amazon/Oracle\n- openSUSE\n- Windows\n\nNote: Source installs require GCC 4.8+, which is not included on older distro releases\n\n### Chef\n\n- Chef Infra Client 15.3+\n\n### Cookbooks\n\n- ark\n\n## Usage\n\nInclude the nodejs recipe to install node on your system based on the default installation method:\n\n```ruby\ninclude_recipe \"nodejs\"\n```\n\n### Install methods\n\n#### Package\n\nInstall node from packages:\n\n```ruby\nnode['nodejs']['install_method'] = 'package' # Not necessary because it's the default\ninclude_recipe \"nodejs\"\n# Or\ninclude_recipe \"nodejs::nodejs_from_package\"\n```\n\nBy default this will setup deb/rpm repositories from nodesource.com, which include up to date NodeJS packages. If you prefer to use distro provided package you can disable this behavior by setting `node['nodejs']['install_repo']` to `false`.\n\n#### Binary\n\nInstall node from official prebuilt binaries:\n\n```ruby\nnode['nodejs']['install_method'] = 'binary'\ninclude_recipe \"nodejs\"\n\n# Or\ninclude_recipe \"nodejs::nodejs_from_binary\"\n\n# Or set a specific version of nodejs to be installed\nnode.default['nodejs']['install_method'] = 'binary'\nnode.default['nodejs']['version'] = '5.9.0'\nnode.default['nodejs']['binary']['checksum'] = '99c4136cf61761fac5ac57f80544140a3793b63e00a65d4a0e528c9db328bf40'\n\n# Or fetch the binary from your own location\nnode.default['nodejs']['install_method'] = 'binary'\nnode.default['nodejs']['binary']['url'] = 'https://s3.amazonaws.com/my-bucket/node-v7.8.0-linux-x64.tar.gz'\nnode.default['nodejs']['binary']['checksum'] = '0bd86f2a39221b532172c7d1acb57f0b0cba88c7b82ea74ba9d1208b9f6f9697'\n```\n\n#### Source\n\nInstall node from sources:\n\n```ruby\nnode['nodejs']['install_method'] = 'source'\ninclude_recipe \"nodejs\"\n# Or\ninclude_recipe \"nodejs::nodejs_from_source\"\n```\n\n#### Chocolatey\n\nInstall node from chocolatey:\n\n```chef\nnode['nodejs']['install_method'] = 'chocolatey'\ninclude_recipe \"nodejs\"\n# Or\ninclude_recipe \"nodejs::nodejs_from_chocolatey\"\n```\n\n## NPM\n\nNpm is included in nodejs installs by default. By default, we are using it and call it `embedded`. Adding recipe `nodejs::npm` assure you to have npm installed and let you choose install method with `node['nodejs']['npm']['install_method']`\n\n```ruby\ninclude_recipe \"nodejs::npm\"\n```\n\n_Warning:_ This recipe will include the `nodejs` recipe, which by default includes `nodejs::nodejs_from_package` if you did not set `node['nodejs']['install_method']`.\n\n## Resources\n\n### npm_package\n\nnote: This resource was previously named nodejs_npm. Calls to that resource name will still function, but cookbooks should be updated for the new npm_package resource name.\n\n`npm_package` lets you install npm packages from various sources:\n\n- npm registry:\n\n  - name: `property :package`\n  - version: `property :version` (optional)\n\n- url: `property :url`\n\n  - for git use `git://{your_repo}`\n\n- from a json (package.json by default): `property :json`\n\n  - use `true` for default\n  - use a `String` to specify json file\n\nPackages can be installed globally (by default) or in a directory (by using `attribute :path`)\n\nYou can specify an `NPM_TOKEN` environment variable for accessing [NPM private modules](https://docs.npmjs.com/private-modules/intro) by using `attribute :npm_token`\n\nYou can specify a `NODE_ENV` environment variable, in the case that some element of your installation depends on this by using `attribute :node_env`. E.g., using [`node-config`](https://www.npmjs.com/package/config) as part of your postinstall script. Please note that adding the `--production` option will override this to `NODE_ENV=production`.\n\nYou can append more specific options to npm command with `attribute :options` array :\n\nYou can specify auto_update as false to stop the npm install command from running and updating an installed package. Running the command will update packages within restrictions imposed by a package.json file. The default behavior is to update automatically.\n\n- use an array of options (w/ dash), they will be added to npm call.\n- ex: `['--production','--force']` or `['--force-latest']`\n\nYou can specify live_stream true for the resource to have the package install information included in the chef-client log outout for better npm package diagnostics and trouble shooting.\n\nThis LWRP attempts to use vanilla npm as much as possible (no custom wrapper).\n\n### Packages\n\n```ruby\nnpm_package 'express'\n\nnpm_package 'async' do\n  version '0.6.2'\nend\n\nnpm_package 'request' do\n  url 'github mikeal/request'\nend\n\nnpm_package 'grunt' do\n  path '/home/random/grunt'\n  json true\n  user 'random'\n  node_env 'staging'\nend\n\nnpm_package 'my_private_module' do\n  path '/home/random/myproject' # The root path to your project, containing a package.json file\n  json true\n  npm_token '12345-abcde-e5d4c3b2a1'\n  user 'random'\n  options ['--production'] # Only install dependencies. Skip devDependencies\nend\n```\n\n[Working Examples](test/cookbooks/nodejs_test/recipes/npm.rb)\n\nOr add packages via attributes (which accept the same attributes as the LWRP above):\n\n```json\n\"nodejs\": {\n  \"npm_packages\": [\n    {\n      \"name\": \"express\"\n    },\n    {\n      \"name\": \"async\",\n      \"version\": \"0.6.2\"\n    },\n    {\n      \"name\": \"request\",\n      \"url\": \"github mikeal/request\"\n    }\n    {\n      \"name\": \"grunt\",\n      \"path\": \"/home/random/grunt\",\n      \"json\": true,\n      \"user\": \"random\"\n    }\n  ]\n}\n```\n\n## Contributors\n\nThis project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false)\n\n### Backers\n\nThank you to all our backers!\n\n![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600&avatarHeight=40)\n\n### Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website.\n\n![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)\n"
  },
  {
    "path": "TESTING.md",
    "content": "# Testing\n\nPlease refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/TESTING.MD).\n"
  },
  {
    "path": "attributes/default.rb",
    "content": "#\n# Cookbook:: nodejs\n# Attributes:: nodejs\n#\n# Copyright:: 2010-2017, Promet Solutions\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ndefault['nodejs']['install_method'] = case node['platform_family']\n                                      when 'smartos', 'rhel', 'debian', 'fedora', 'mac_os_x', 'suse', 'amazon'\n                                        'package'\n                                      when 'windows'\n                                        'chocolatey'\n                                      else\n                                        'source'\n                                      end\n\ndefault['nodejs']['version'] = '22.11.0'\n\ndefault['nodejs']['prefix_url']['node'] = 'https://nodejs.org/dist/'\n\ndefault['nodejs']['tmpdir'] = '/tmp'\ndefault['nodejs']['source']['url']      = nil # Auto generated\ndefault['nodejs']['source']['checksum'] = '24e5130fa7bc1eaab218a0c9cb05e03168fa381bb9e3babddc6a11f655799222'\n\ndefault['nodejs']['binary']['url'] = nil # Auto generated\ndefault['nodejs']['binary']['checksum']['linux_x64'] = '8c9f4c95c254336fcb2c768e746f4316b8176adc0fb599cbbb460d0933991d12'\ndefault['nodejs']['binary']['checksum']['linux_arm64'] = 'd4acf5c0380c96c867428d0232666d3327dc5fa83a694d7b63f728a76ece84b2'\ndefault['nodejs']['binary']['append_env_path'] = true\n\ndefault['nodejs']['make_threads'] = node['cpu'] ? node['cpu']['total'].to_i : 2\n\ndefault['nodejs']['manage_node'] = true\n"
  },
  {
    "path": "attributes/npm.rb",
    "content": "default['nodejs']['npm']['install_method'] = 'embedded'\ndefault['nodejs']['npm']['version'] = 'latest'\n"
  },
  {
    "path": "attributes/packages.rb",
    "content": "include_attribute 'nodejs::default'\ninclude_attribute 'nodejs::repo'\n\ndefault['nodejs']['packages'] = value_for_platform_family(\n  'debian' => node['nodejs']['install_repo'] ? ['nodejs'] : %w(nodejs npm nodejs-dev),\n  %w(rhel fedora amazon) => node['nodejs']['install_repo'] ? %w(nodejs nodejs-devel) : %w(nodejs npm nodejs-dev),\n  'suse' => %w(nodejs npm nodejs-devel),\n  'mac_os_x' => ['node'],\n  'freebsd' => %w(node npm),\n  'default' => ['nodejs']\n)\n\n# Add options and actions by package name\ndefault['nodejs']['package_action'] = { default: :install }\ndefault['nodejs']['package_options'] = { default: '' }\n# Disable upstream DNF module on EL8 based systems\ndefault['nodejs']['dnf_module'] = false\n"
  },
  {
    "path": "attributes/repo.rb",
    "content": "case node['platform_family']\nwhen 'debian'\n  default['nodejs']['install_repo'] = true\n  default['nodejs']['repo']         = 'https://deb.nodesource.com/node_20.x'\n  default['nodejs']['distribution'] = 'nodistro'\n  default['nodejs']['key']          = 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key'\nwhen 'rhel', 'amazon', 'fedora'\n  default['nodejs']['install_repo'] = true\n  node_version = platform?('amazon') ? '17.x' : '20.x'\n  default['nodejs']['repo']         = \"https://rpm.nodesource.com/pub_#{node_version}/nodistro/nodejs/$basearch\"\n  default['nodejs']['key']          = 'https://rpm.nodesource.com/gpgkey/ns-operations-public.key'\nend\n"
  },
  {
    "path": "chefignore",
    "content": "# Put files/directories that should be ignored in this file when uploading\n# to a Chef Infra Server or Supermarket.\n# Lines that start with '# ' are comments.\n\n# OS generated files #\n######################\n.DS_Store\nehthumbs.db\nIcon?\nnohup.out\nThumbs.db\n.envrc\n\n# EDITORS #\n###########\n.#*\n.project\n.settings\n*_flymake\n*_flymake.*\n*.bak\n*.sw[a-z]\n*.tmproj\n*~\n\\#*\nREVISION\nTAGS*\ntmtags\n.vscode\n.editorconfig\n\n## COMPILED ##\n##############\n*.class\n*.com\n*.dll\n*.exe\n*.o\n*.pyc\n*.so\n*/rdoc/\na.out\nmkmf.log\n\n# Testing #\n###########\n.circleci/*\n.codeclimate.yml\n.delivery/*\n.foodcritic\n.kitchen*\n.mdlrc\n.overcommit.yml\n.rspec\n.rubocop.yml\n.travis.yml\n.watchr\n.yamllint\nazure-pipelines.yml\nDangerfile\nexamples/*\nfeatures/*\nGuardfile\nkitchen*.yml\nmlc_config.json\nProcfile\nRakefile\nspec/*\ntest/*\n\n# SCM #\n#######\n.git\n.gitattributes\n.gitconfig\n.github/*\n.gitignore\n.gitkeep\n.gitmodules\n.svn\n*/.bzr/*\n*/.git\n*/.hg/*\n*/.svn/*\n\n# Berkshelf #\n#############\nBerksfile\nBerksfile.lock\ncookbooks/*\ntmp\n\n# Bundler #\n###########\nvendor/*\nGemfile\nGemfile.lock\n\n# Policyfile #\n##############\nPolicyfile.rb\nPolicyfile.lock.json\n\n# Documentation #\n#############\nCODE_OF_CONDUCT*\nCONTRIBUTING*\ndocumentation/*\nTESTING*\nUPGRADING*\n\n# Vagrant #\n###########\n.vagrant\nVagrantfile\n"
  },
  {
    "path": "documentation/.gitkeep",
    "content": ""
  },
  {
    "path": "kitchen.dokken.yml",
    "content": "driver:\n  name: dokken\n  privileged: true\n  chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>\n\ntransport: { name: dokken }\nprovisioner: { name: dokken }\n\nplatforms:\n  - name: almalinux-8\n    driver:\n      image: dokken/almalinux-8\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: almalinux-9\n    driver:\n      image: dokken/almalinux-9\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: almalinux-10\n    driver:\n      image: dokken/almalinux-10\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: amazonlinux-2023\n    driver:\n      image: dokken/amazonlinux-2023\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: centos-stream-9\n    driver:\n      image: dokken/centos-stream-9\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: centos-stream-10\n    driver:\n      image: dokken/centos-stream-10\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: debian-12\n    driver:\n      image: dokken/debian-12\n      pid_one_command: /bin/systemd\n\n  - name: debian-13\n    driver:\n      image: dokken/debian-13\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: fedora-latest\n    driver:\n      image: dokken/fedora-latest\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: opensuse-leap-15\n    driver:\n      image: dokken/opensuse-leap-15\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: oraclelinux-8\n    driver:\n      image: dokken/oraclelinux-8\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: oraclelinux-9\n    driver:\n      image: dokken/oraclelinux-9\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: rockylinux-8\n    driver:\n      image: dokken/rockylinux-8\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: rockylinux-9\n    driver:\n      image: dokken/rockylinux-9\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: rockylinux-10\n    driver:\n      image: dokken/rockylinux-10\n      pid_one_command: /usr/lib/systemd/systemd\n\n  - name: ubuntu-20.04\n    driver:\n      image: dokken/ubuntu-20.04\n      pid_one_command: /bin/systemd\n\n  - name: ubuntu-22.04\n    driver:\n      image: dokken/ubuntu-22.04\n      pid_one_command: /bin/systemd\n\n  - name: ubuntu-24.04\n    driver:\n      image: dokken/ubuntu-24.04\n      pid_one_command: /bin/systemd\n"
  },
  {
    "path": "kitchen.exec.yml",
    "content": "---\ndriver: { name: exec }\ntransport: { name: exec }\n\nplatforms:\n  - name: macos-latest\n  - name: windows-latest\n"
  },
  {
    "path": "kitchen.global.yml",
    "content": "---\nprovisioner:\n  name: chef_infra\n  product_name: chef\n  product_version: <%= ENV['CHEF_VERSION'] || 'latest' %>\n  channel: stable\n  install_strategy: once\n  chef_license: accept\n  enforce_idempotency: <%= ENV['ENFORCE_IDEMPOTENCY'] || true %>\n  multiple_converge: <%= ENV['MULTIPLE_CONVERGE'] || 2 %>\n  deprecations_as_errors: true\n  log_level: <%= ENV['CHEF_LOG_LEVEL'] || 'auto' %>\n\nverifier:\n  name: inspec\n\nplatforms:\n  - name: almalinux-8\n  - name: almalinux-9\n  - name: amazonlinux-2023\n  - name: centos-stream-9\n  - name: debian-11\n  - name: debian-12\n  - name: fedora-latest\n  - name: opensuse-leap-15\n  - name: oraclelinux-8\n  - name: oraclelinux-9\n  - name: rockylinux-8\n  - name: rockylinux-9\n  - name: ubuntu-20.04\n  - name: ubuntu-22.04\n  - name: ubuntu-24.04\n"
  },
  {
    "path": "kitchen.yml",
    "content": "---\ndriver:\n  name: vagrant\n\nsuites:\n  - name: default\n    run_list:\n      - recipe[nodejs::default]\n    attributes:\n      nodejs:\n        manage_node: true\n        npm:\n          install_method: embedded\n        npm_packages:\n          - name: express\n          - name: socket.io\n            version: 1.0.4\n          - name: express\n            action: :uninstall\n  - name: npm_embedded\n    run_list:\n      - recipe[nodejs::npm]\n    attributes:\n      nodejs:\n        npm:\n          install_method: embedded\n  - name: npm_source\n    run_list:\n      - recipe[nodejs::npm]\n    attributes:\n      nodejs:\n        npm:\n          install_method: source\n  - name: package\n    run_list:\n      - recipe[test::default]\n  - name: source\n    run_list:\n      - recipe[test::source]\n  - name: options\n    run_list:\n      - recipe[nodejs]\n    attributes:\n      nodejs:\n        packages:\n          - nodejs\n          - acpid\n          - adcli\n        package_options:\n          acpid: \"--force-yes\"\n        package_action:\n          adcli: :nothing\n"
  },
  {
    "path": "libraries/nodejs_helper.rb",
    "content": "module NodeJs\n  module Helper\n    def npm_dist\n      if node['nodejs']['npm']['url']\n        { 'url' => node['nodejs']['npm']['url'] }\n      else\n\n        require 'open-uri'\n        require 'json'\n        result = JSON.parse(URI.parse(\"https://registry.npmjs.org/npm/#{node['nodejs']['npm']['version']}\").read, max_nesting: false)\n        ret = { 'url' => result['dist']['tarball'], 'version' => result['_npmVersion'], 'shasum' => result['dist']['shasum'] }\n        Chef::Log.debug(\"Npm dist #{ret}\")\n        ret\n      end\n    end\n\n    def npm_list(package, path = nil, environment = {})\n      require 'json'\n      cmd = if path\n              Mixlib::ShellOut.new(\"npm list #{package} -json\", cwd: path, environment: environment)\n            else\n              Mixlib::ShellOut.new(\"npm list #{package} -global -json\", environment: environment)\n            end\n\n      begin\n        JSON.parse(cmd.run_command.stdout, max_nesting: false)\n      rescue JSON::ParserError => e\n        Chef::Log.error(\"nodejs::library::nodejs_helper::npm_list exception #{e}\")\n        {}\n      end\n    end\n\n    def url_valid?(list, package)\n      require 'open-uri'\n\n      begin\n        URI.parse(list.fetch(package, {}).fetch('resolved'))\n      rescue KeyError\n        # the package may have been installed without using a url\n        true\n      rescue URI::InvalidURIError\n        false\n      end\n    end\n\n    def version_valid?(list, package, version)\n      (version ? list[package]['version'] == version : true)\n    end\n\n    def npm_package_installed?(package, version = nil, path = nil, environment = {})\n      list = npm_list(package, path, environment)['dependencies']\n      # Return true if package installed and installed to good version\n      # see if we really want to add the url check\n      !list.nil? && list.key?(package) && version_valid?(list, package, version) && url_valid?(list, package)\n    end\n  end\nend\n"
  },
  {
    "path": "metadata.rb",
    "content": "name              'nodejs'\nmaintainer        'Sous Chefs'\nmaintainer_email  'help@sous-chefs.org'\nlicense           'Apache-2.0'\ndescription       'Installs/Configures node.js'\nversion           '10.2.3'\nsource_url        'https://github.com/sous-chefs/nodejs'\nissues_url        'https://github.com/sous-chefs/nodejs/issues'\nchef_version      '>= 15.3'\n\nsupports 'amazon'\nsupports 'centos'\nsupports 'debian'\nsupports 'mac_os_x'\nsupports 'opensuseleap'\nsupports 'oracle'\nsupports 'redhat'\nsupports 'scientific'\nsupports 'smartos'\nsupports 'suse'\nsupports 'ubuntu'\nsupports 'windows'\n\ndepends 'ark', '>= 2.0.2'\ndepends 'chocolatey', '>= 3.0'\ndepends 'yum', '>= 7.2'\n"
  },
  {
    "path": "recipes/default.rb",
    "content": "\n# Author:: Marius Ducea (marius@promethost.com)\n# Cookbook:: nodejs\n# Recipe:: default\n#\n# Copyright:: 2010-2017, Promet Solutions\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ninclude_recipe 'nodejs::install' if node['nodejs']['manage_node']\ninclude_recipe 'nodejs::npm' if node['nodejs']['manage_node']\ninclude_recipe 'nodejs::npm_packages' if node['nodejs']['manage_node']\n"
  },
  {
    "path": "recipes/install.rb",
    "content": "#\n# Author:: Marius Ducea (marius@promethost.com)\n# Cookbook:: nodejs\n# Recipe:: install\n#\n# Copyright:: 2010-2017, Promet Solutions\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ninclude_recipe \"nodejs::nodejs_from_#{node['nodejs']['install_method']}\"\n"
  },
  {
    "path": "recipes/iojs.rb",
    "content": "Chef::Log.fatal('The nodejs::iojs recipe has been deprecated. If you need iojs installation pin to cookbook version 3.0.1.')\n"
  },
  {
    "path": "recipes/nodejs.rb",
    "content": "#\n# Author:: Marius Ducea (marius@promethost.com)\n# Cookbook:: nodejs\n# Recipe:: nodejs\n#\n# Copyright:: 2010-2017, Promet Solutions\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nChef::Log.fatal('The nodejs::nodejs recipe is no longer used. Use nodejs::install to install nodejs instead.')\n"
  },
  {
    "path": "recipes/nodejs_from_binary.rb",
    "content": "#\n# Author:: Julian Wilde (jules@jules.com.au)\n# Cookbook:: nodejs\n# Recipe:: install_from_binary\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nChef::DSL::Recipe.include NodeJs::Helper\n\n# Shamelessly borrowed from http://docs.chef.io/dsl_recipe_method_platform.html\n# Surely there's a more canonical way to get arch?\narch = if node['kernel']['machine'] =~ /armv6l/\n         # FIXME: This should really check the version of node we're looking for\n         # as it seems that they haven't build an `arm-pi` version in a while...\n         # if it's old, return this, otherwise just return `node['kernel']['machine']`\n         'arm-pi' # assume a raspberry pi\n       elsif node['kernel']['machine'] =~ /aarch64/\n         'arm64'\n       elsif node['kernel']['machine'] =~ /x86_64/\n         'x64'\n       elsif node['kernel']['machine'] =~ /\\d86/\n         'x86'\n       else\n         node['kernel']['machine']\n       end\n\n# needed to uncompress the binary\npackage 'tar' if platform_family?('rhel', 'fedora', 'amazon', 'suse')\n\n# package_stub is for example: \"node-v6.9.1-linux-x64.tar.gz\"\nversion = \"v#{node['nodejs']['version']}/\"\nprefix = node['nodejs']['prefix_url']['node']\n\nfilename = \"node-v#{node['nodejs']['version']}-linux-#{arch}.tar.gz\"\narchive_name = 'nodejs-binary'\nbinaries = ['bin/node']\n\nbinaries.push('bin/npm') if node['nodejs']['npm']['install_method'] == 'embedded'\nbinaries.push('bin/npx') if node['nodejs']['npm']['install_method'] == 'embedded'\n\nif node['nodejs']['binary']['url']\n  nodejs_bin_url = node['nodejs']['binary']['url']\n  checksum = node['nodejs']['binary']['checksum']\nelse\n  nodejs_bin_url = ::URI.join(prefix, version, filename).to_s\n  checksum = node['nodejs']['binary']['checksum'][\"linux_#{arch}\"]\nend\n\nark archive_name do\n  url nodejs_bin_url\n  version node['nodejs']['version']\n  checksum checksum\n  has_binaries binaries\n  append_env_path node['nodejs']['binary']['append_env_path']\n  action :install\nend\n"
  },
  {
    "path": "recipes/nodejs_from_chocolatey.rb",
    "content": "#\n# Author:: Hossein Margani (hossein@margani.dev)\n# Cookbook:: nodejs\n# Recipe:: install_from_chocolatey\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ninclude_recipe 'chocolatey'\n\nchocolatey_package 'nodejs-lts' do\n  version node['nodejs']['version'] if node['nodejs']['version']\n  action :upgrade\nend\n"
  },
  {
    "path": "recipes/nodejs_from_package.rb",
    "content": "#\n# Author:: Nathan L Smith (nlloyds@gmail.com)\n# Author:: Marius Ducea (marius@promethost.com)\n# Cookbook:: nodejs\n# Recipe:: package\n#\n# Copyright:: 2012-2017, Cramer Development, Inc.\n# Copyright:: 2013-2017, Opscale\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ninclude_recipe 'nodejs::repo' if node['nodejs']['install_repo']\n\nunless node['nodejs']['packages']\n  Chef::Log.error 'No package for nodejs'\n  Chef::Log.warn 'Please use the source or binary method to install node'\n  return\nend\n\nif platform_family?('rhel', 'fedora') && node['platform_version'].to_i >= 8 && !node['nodejs']['dnf_module']\n  dnf_module 'nodejs' do\n    action :disable\n    only_if 'dnf module list nodejs'\n  end\nend\n\nnode['nodejs']['packages'].each do |node_pkg|\n  package node_pkg do\n    action node['nodejs']['package_action'][node_pkg] if node['nodejs']['package_action'][node_pkg]\n    options node['nodejs']['package_options'][node_pkg] if node['nodejs']['package_options'][node_pkg]\n  end\nend\n"
  },
  {
    "path": "recipes/nodejs_from_source.rb",
    "content": "#\n# Author:: Marius Ducea (marius@promethost.com)\n# Cookbook:: nodejs\n# Recipe:: source\n#\n# Copyright:: 2010-2017, Promet Solutions\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nChef::DSL::Recipe.include NodeJs::Helper\n\nbuild_essential 'install build tools'\n\ncase node['platform_family']\nwhen 'rhel', 'fedora', 'amazon'\n  package %w(openssl-devel python3 tar)\nwhen 'debian'\n  package %w(libssl-dev python3)\nelse\n  package %w(python3)\nend\n\nversion = \"v#{node['nodejs']['version']}/\"\nprefix = node['nodejs']['prefix_url']['node']\nfilename = \"node-v#{node['nodejs']['version']}.tar.gz\"\narchive_name = 'nodejs-source'\n\nnodejs_src_url = node['nodejs']['source']['url'] || ::URI.join(prefix, version, filename).to_s\n\nark archive_name do\n  url nodejs_src_url\n  version node['nodejs']['version']\n  checksum node['nodejs']['source']['checksum']\n  make_opts [\"-j #{node['nodejs']['make_threads']}\"]\n  action :install_with_make\n  environment(PYTHON: 'python3')\nend\n"
  },
  {
    "path": "recipes/npm.rb",
    "content": "#\n# Author:: Marius Ducea (marius@promethost.com)\n# Cookbook:: nodejs\n# Recipe:: npm\n#\n# Copyright:: 2010-2017, Promet Solutions\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncase node['nodejs']['npm']['install_method']\nwhen 'embedded'\n  include_recipe 'nodejs::install'\nwhen 'source'\n  include_recipe 'nodejs::npm_from_source'\nelse\n  Chef::Log.error('No install method found for npm')\nend\n"
  },
  {
    "path": "recipes/npm_from_source.rb",
    "content": "#\n# Author:: Marius Ducea (marius@promethost.com)\n# Cookbook:: nodejs\n# Recipe:: npm\n#\n# Copyright:: 2010-2017, Promet Solutions\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nChef::DSL::Recipe.include NodeJs::Helper\n\ninclude_recipe 'nodejs::nodejs_from_source'\n\ndist = npm_dist\n\nark 'npm' do\n  url dist['url']\n  checksum dist['checksum']\n  version dist['version']\n  action :install_with_make\nend\n"
  },
  {
    "path": "recipes/npm_packages.rb",
    "content": "if node['nodejs'].key?('npm_packages')\n  node['nodejs']['npm_packages'].each do |pkg|\n    pkg_action = pkg.key?('action') ? pkg['action'] : :install\n    f = npm_package \"nodejs_npm-#{pkg['name']}-#{pkg_action}\" do\n      action :nothing\n      package pkg['name']\n    end\n    pkg.each do |key, value|\n      f.send(key, value) unless key == 'name' || key == 'action'\n    end\n    f.action(pkg_action)\n  end\nend\n"
  },
  {
    "path": "recipes/repo.rb",
    "content": "case node['platform_family']\nwhen 'debian'\n  # Install necessary packages for downloading and verifying new repository information\n  package %w(ca-certificates curl gnupg apt-transport-https)\n\n  # Create a directory for the new repository's keyring, if it doesn't exist\n  directory '/etc/apt/keyrings'\n\n  # Download the new repository's GPG key and save it in the keyring directory\n  execute 'add nodejs gpg key' do\n    command \"curl -fsSL #{node['nodejs']['key']} | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg\"\n    not_if { ::File.exist? '/etc/apt/keyrings/nodesource.gpg' }\n  end\n\n  # Prefer nodesource over Ubuntu universe packages by giving a higher priority (default 500)\n  apt_preference 'nodesource' do\n    glob '*'\n    pin 'origin deb.nodesource.com'\n    pin_priority '600'\n  end\n\n  if Gem::Version.new('18.3.0') <= Chef::VERSION\n    apt_repository 'nodesource' do\n      uri node['nodejs']['repo']\n      components ['main']\n      options ['signed-by=/etc/apt/keyrings/nodesource.gpg']\n      distribution node['nodejs']['distribution']\n    end\n  else\n    # Chef Infra < 18.3 doesn't support options attribute, fallback to (deprecated) apt-key method\n    apt_repository 'nodesource' do\n      uri node['nodejs']['repo']\n      components ['main']\n      key '2F59B5F99B1BE0B4'\n      keyserver 'keyserver.ubuntu.com'\n      distribution node['nodejs']['distribution']\n    end\n  end\n\nwhen 'rhel', 'fedora', 'amazon'\n  yum_repository 'nodesource-nodejs' do\n    description 'nodesource.com nodejs repository'\n    baseurl node['nodejs']['repo']\n    gpgkey node['nodejs']['key']\n    priority '9'\n    options(module_hotfixes: 1)\n  end\nend\n"
  },
  {
    "path": "release-please-config.json",
    "content": "{\n  \"packages\": {\n    \".\": {\n      \"package-name\": \"nodejs\",\n      \"changelog-path\": \"CHANGELOG.md\",\n      \"release-type\": \"ruby\",\n      \"include-component-in-tag\": false,\n      \"version-file\": \"metadata.rb\"\n    }\n  },\n  \"$schema\": \"https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json\"\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": [\"config:base\"],\n  \"packageRules\": [\n    {\n      \"groupName\": \"Actions\",\n      \"matchUpdateTypes\": [\"minor\", \"patch\", \"pin\"],\n      \"automerge\": true,\n      \"addLabels\": [\"Release: Patch\", \"Skip: Announcements\"]\n    },\n    {\n      \"groupName\": \"Actions\",\n      \"matchUpdateTypes\": [\"major\"],\n      \"automerge\": false,\n      \"addLabels\": [\"Release: Patch\", \"Skip: Announcements\"]\n    }\n  ]\n}\n"
  },
  {
    "path": "resources/npm_package.rb",
    "content": "#\n# Cookbook:: nodejs\n# Resource:: npm\n#\n# Author:: Sergey Balbeko <sergey@balbeko.com>\n#\n# Copyright:: 2012-2017, Sergey Balbeko\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nresource_name :npm_package\nprovides :npm_package\nunified_mode true\n\n# backwards compatibility for the old resource name\nprovides :nodejs_npm\n\nproperty :package, String, name_property: true\nproperty :version, String\nproperty :path, String\nproperty :url, String\nproperty :json, [String, true, false]\nproperty :npm_token, String\nproperty :options, Array, default: []\nproperty :user, String\nproperty :group, String\nproperty :live_stream, [false, true], default: false\nproperty :node_env, String\nproperty :auto_update, [true, false], default: true\n\ndef initialize(*args)\n  super\n  @run_context.include_recipe 'nodejs::npm' if node['nodejs']['manage_node']\nend\n\naction :install do\n  execute \"install NPM package #{new_resource.package}\" do\n    cwd new_resource.path\n    command \"npm install #{npm_options}\"\n    user new_resource.user\n    group new_resource.group\n    environment npm_env_vars\n    live_stream new_resource.live_stream\n    not_if { package_installed? && no_auto_update? }\n  end\nend\n\naction :uninstall do\n  execute \"uninstall NPM package #{new_resource.package}\" do\n    cwd new_resource.path\n    command \"npm uninstall #{npm_options}\"\n    user new_resource.user\n    group new_resource.group\n    environment npm_env_vars\n    live_stream new_resource.live_stream\n    only_if { package_installed? }\n  end\nend\n\naction_class do\n  include NodeJs::Helper\n\n  def npm_env_vars\n    env_vars = {}\n    env_vars['HOME'] = ::Dir.home(new_resource.user) if new_resource.user\n    env_vars['USER'] = new_resource.user if new_resource.user\n    env_vars['NPM_TOKEN'] = new_resource.npm_token if new_resource.npm_token\n    env_vars['NODE_ENV'] = new_resource.node_env if new_resource.node_env\n\n    env_vars\n  end\n\n  def package_installed?\n    new_resource.package && npm_package_installed?(new_resource.package, new_resource.version, new_resource.path, npm_env_vars)\n  end\n\n  def no_auto_update?\n    new_resource.package && !new_resource.auto_update\n  end\n\n  def npm_options\n    options = ''\n    options << ' -global' unless new_resource.path\n    new_resource.options.each do |option|\n      options << \" #{option}\"\n    end\n    options << \" #{npm_package}\"\n  end\n\n  def npm_package\n    if new_resource.json\n      new_resource.json.is_a?(String) ? new_resource.json : nil\n    elsif new_resource.url\n      new_resource.url\n    elsif new_resource.package\n      new_resource.version ? \"#{new_resource.package}@#{new_resource.version}\" : new_resource.package\n    else\n      Chef::Log.error(\"No good options found to install #{new_resource.package}\")\n    end\n  end\nend\n"
  },
  {
    "path": "spec/rspec_helper.rb",
    "content": "Dir.glob('libraries/*.rb').each do |lib|\n  require_relative \"../#{lib}\"\nend\n\nRSpec.configure do |config|\n  config.expose_dsl_globally = true\n  config.mock_with :rspec do |mocks|\n    mocks.allow_message_expectations_on_nil = true\n  end\nend\n"
  },
  {
    "path": "spec/spec_helper.rb",
    "content": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n  config.color = true               # Use color in STDOUT\n  config.formatter = :documentation # Use the specified formatter\n  config.log_level = :error         # Avoid deprecation notice SPAM\nend\n"
  },
  {
    "path": "spec/unit/library/helper_spec.rb",
    "content": "\nrequire 'rspec_helper'\nrequire 'mixlib/shellout'\nrequire 'ostruct'\n\ndescribe 'helper methods' do\n  before(:each) do\n    @mt = MT.new\n  end\n\n  describe 'npm_dist' do\n    it 'should return a url if specified in the node attributes' do\n      n = { 'nodejs': { 'npm': { 'url': 'get it' } } }\n      n = Mash.new(n)\n      allow(@mt).to receive(:node).and_return(n)\n      expect(@mt.npm_dist['url']).to eq('get it')\n    end\n    it 'should return a url based on the version' do\n      n = { 'nodejs': { 'npm': { 'url': nil, 'version': '6.14.8' } } }\n      n = Mash.new(n)\n      allow(@mt).to receive(:node).and_return(n)\n      expect(@mt.npm_dist['url']).to eq('https://registry.npmjs.org/npm/-/npm-6.14.8.tgz')\n    end\n  end\n\n  describe 'npm_list' do\n    it 'should list information for a package' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmxss)\n      expect(@mt.npm_list('xss')).to eq({ 'dependencies' => { 'xss' => { 'from' => 'xss', 'resolved' => 'https://registry.npmjs.org/xss/-/xss-1.0.8.tgz', 'version' => '1.0.8' } } })\n    end\n    it 'should handle bad output fomr the npm list command' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npminvalid)\n      expect(@mt.npm_list('other')).to eq({})\n    end\n  end\n\n  describe 'url_valid?' do\n    it 'should return true the url of an installed package for a valid value' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmxss)\n      list = @mt.npm_list('xss')['dependencies']\n      expect(@mt.url_valid?(list, 'xss')).to be_truthy\n    end\n    it 'should return true an installed package that does not have a url' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmcssfilter)\n      list = @mt.npm_list('cssfilter')['dependencies']\n      expect(@mt.url_valid?(list, 'cssfilter')).to eq(true)\n    end\n    it 'should return false for an installed package that has an invalid url' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmglobal)\n      list = @mt.npm_list('security')['dependencies']\n      expect(@mt.url_valid?(list, 'security')).to eq(false)\n    end\n  end\n\n  describe 'version_valid?' do\n    it 'should check that the installed version of a package matches the expected' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmxss)\n      list = @mt.npm_list('xss')['dependencies']\n      expect(@mt.version_valid?(list, 'xss', '1.0.8')).to be_truthy\n    end\n    it 'should return false if the version a package does not match the expected' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmxss)\n      list = @mt.npm_list('xss')['dependencies']\n      expect(@mt.version_valid?(list, 'xss', '1.1.1')).to be_falsy\n    end\n  end\n\n  describe 'npm_package_installed?' do\n    it 'should return false if any of the checks fail - wrong version' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmxss)\n      expect(@mt.npm_package_installed?('xss', '1.1.1')).to be_falsy\n    end\n    it 'should return false if any of the checks fail - nothing found' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmempty)\n      expect(@mt.npm_package_installed?('xss')).to be_falsy\n    end\n    it 'should return true checking package and version' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmxss)\n      expect(@mt.npm_package_installed?('xss', '1.0.8')).to be_truthy\n    end\n    it 'should return true checking package installed' do\n      allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(npmxss)\n      expect(@mt.npm_package_installed?('xss')).to be_truthy\n    end\n  end\nend\n\nclass MT\n  include NodeJs::Helper\nend\n\ndef npmempty\n  os = OpenStruct.new\n  os.stdout =\n    '{}'\n  os\nend\n\ndef npmglobal\n  os = OpenStruct.new\n  os.stdout =\n    '{\n    \"dependencies\": {\n      \"dtrace\": {\n        \"version\": \"0.0.0\",\n        \"from\": \"dtrace\",\n        \"resolved\": \"https://registry.npmjs.org/dtrace/-/dtrace-0.0.0.tgz\"\n      },\n      \"dtrace-provider\": {\n        \"version\": \"0.8.8\",\n        \"from\": \"dtrace-provider\",\n        \"resolved\": \"https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz\",\n        \"dependencies\": {\n          \"nan\": {\n            \"version\": \"2.14.1\",\n            \"from\": \"nan@^2.14.0\",\n            \"resolved\": \"https://registry.npmjs.org/nan/-/nan-2.14.1.tgz\"\n          }\n        }\n      },\n      \"sax\": {\n        \"version\": \"1.2.4\",\n        \"from\": \"sax\",\n        \"resolved\": \"https://registry.npmjs.org/sax/-/sax-1.2.4.tgz\"\n      },\n      \"security\": {\n        \"version\": \"1.0.0\",\n        \"from\": \"security\",\n        \"resolved\": \"http://invalid##registry.npmjs.org/security/-/security-1.0.0.tgz\"\n      },\n      \"xss\": {\n        \"version\": \"1.0.8\",\n        \"from\": \"xss\",\n        \"resolved\": \"https://registry.npmjs.org/xss/-/xss-1.0.8.tgz\",\n        \"dependencies\": {\n          \"commander\": {\n            \"version\": \"2.20.3\",\n            \"from\": \"commander@^2.20.3\",\n            \"resolved\": \"https://registry.npmjs.org/commander/-/commander-2.20.3.tgz\"\n          },\n          \"cssfilter\": {\n            \"version\": \"0.0.10\",\n            \"from\": \"cssfilter@0.0.10\"\n          }\n        }\n      }\n    }\n  }'\n  os\nend\n\ndef npminvalid\n  os = OpenStruct.new\n  os.stdout =\n    'Invalid return'\n  os\nend\n\ndef npmxss\n  os = OpenStruct.new\n  os.stdout =\n    '{\n    \"dependencies\": {\n      \"xss\": {\n        \"version\": \"1.0.8\",\n        \"from\": \"xss\",\n        \"resolved\": \"https://registry.npmjs.org/xss/-/xss-1.0.8.tgz\"\n     }\n    }\n  }'\n  os\nend\n\ndef npmcssfilter\n  os = OpenStruct.new\n  os.stdout =\n    '{\n    \"dependencies\": {\n      \"xss\": {\n        \"version\": \"1.0.8\",\n        \"from\": \"xss\",\n        \"resolved\": \"https://registry.npmjs.org/xss/-/xss-1.0.8.tgz\",\n        \"dependencies\": {\n          \"cssfilter\": {\n            \"version\": \"0.0.10\",\n            \"from\": \"cssfilter@0.0.10\",\n            \"resolved\": \"https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz\"\n          }\n        }\n      }\n    }\n  }'\n  os\nend\n"
  },
  {
    "path": "spec/unit/recipes/default_spec.rb",
    "content": "require 'spec_helper'\n\ndescribe 'default recipe on ubuntu 22.04' do\n  let(:runner) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '22.04') }\n  let(:chef_run) { runner.converge('nodejs::default') }\n\n  it 'includes the package install recipes' do\n    expect(chef_run).to include_recipe('nodejs::nodejs_from_package')\n    expect(chef_run).to include_recipe('nodejs::npm_packages')\n  end\n\n  it 'converges successfully' do\n    expect { :chef_run }.to_not raise_error\n  end\nend\n\ndescribe 'default recipe on centos 8' do\n  let(:runner) { ChefSpec::ServerRunner.new(platform: 'centos', version: '8') }\n  let(:chef_run) { runner.converge('nodejs::default') }\n\n  it 'includes the package install recipes' do\n    stub_command('dnf module list nodejs').and_return(0)\n    expect(chef_run).to include_recipe('nodejs::nodejs_from_package')\n    expect(chef_run).to include_recipe('nodejs::npm_packages')\n  end\n\n  it 'converges successfully' do\n    expect { :chef_run }.to_not raise_error\n  end\nend\n\ndescribe 'default recipe on debian 12' do\n  let(:runner) { ChefSpec::ServerRunner.new(platform: 'debian', version: '12') }\n  let(:chef_run) { runner.converge('nodejs::default') }\n\n  it 'includes the package install recipes' do\n    expect(chef_run).to include_recipe('nodejs::nodejs_from_package')\n    expect(chef_run).to include_recipe('nodejs::npm_packages')\n  end\n\n  it 'converges successfully' do\n    expect { :chef_run }.to_not raise_error\n  end\nend\n\ndescribe 'default recipe on mac_os_x' do\n  let(:runner) { ChefSpec::ServerRunner.new(platform: 'mac_os_x') }\n  let(:chef_run) { runner.converge('nodejs::default') }\n\n  it 'includes the package install recipes' do\n    expect(chef_run).to include_recipe('nodejs::nodejs_from_package')\n    expect(chef_run).to include_recipe('nodejs::npm_packages')\n  end\n\n  it 'converges successfully' do\n    expect { :chef_run }.to_not raise_error\n  end\nend\n\ndescribe 'default recipe on fedora' do\n  let(:runner) { ChefSpec::ServerRunner.new(platform: 'fedora') }\n  let(:chef_run) do\n    stub_command('dnf module list nodejs').and_return(0)\n    runner.converge('nodejs::default')\n  end\n\n  it 'includes the package install recipes' do\n    expect(chef_run).to include_recipe('nodejs::nodejs_from_package')\n    expect(chef_run).to include_recipe('nodejs::npm_packages')\n  end\n\n  it 'converges successfully' do\n    expect { :chef_run }.to_not raise_error\n  end\nend\n"
  },
  {
    "path": "test/cookbooks/test/metadata.rb",
    "content": "name 'test'\nversion '0.1.0'\n\ndepends 'git'\ndepends 'nodejs'\n"
  },
  {
    "path": "test/cookbooks/test/recipes/chocolatey.rb",
    "content": "node.default['nodejs']['install_method'] = 'chocolatey'\ninclude_recipe 'nodejs::default'\ninclude_recipe 'test::resource_win'\n"
  },
  {
    "path": "test/cookbooks/test/recipes/default.rb",
    "content": "apt_update 'update'\n\ninclude_recipe 'nodejs::default'\ninclude_recipe 'test::resource'\n"
  },
  {
    "path": "test/cookbooks/test/recipes/package.rb",
    "content": "apt_update 'update'\n\nnode.default['nodejs']['install_method'] = 'package'\n\ninclude_recipe 'nodejs::default'\n"
  },
  {
    "path": "test/cookbooks/test/recipes/resource.rb",
    "content": "apt_update 'update'\n\ninclude_recipe 'nodejs::npm'\ninclude_recipe 'git'\n\nuser 'random' do\n  manage_home true\n  home '/home/random'\nend\n\nuser 'random1' do\n  manage_home true\n  home '/home/random1'\nend\n\nuser 'random2' do\n  manage_home true\n  home '/home/random2'\nend\n\n# global \"express\" using the old resource name\nnodejs_npm 'express'\n\nnpm_package 'async' do\n  version '0.6.2'\nend\n\nnpm_package 'xss' do\n  version '1.0.7'\nend\n\nnpm_package 'xss noupgrade' do\n  package 'xss'\n  auto_update false\nend\n\nnpm_package 'minify' do\n  version '5.2.0'\nend\n\nnpm_package 'minify upgrade' do\n  package 'minify'\n  live_stream true\nend\n\nnpm_package 'request' do\n  url 'github mikeal/request'\n  live_stream true\nend\n\nnpm_package 'mocha' do\n  options ['--force', '--production']\nend\n\ngit '/home/random2/grunt' do\n  repository 'https://github.com/gruntjs/grunt'\n  user 'random2'\nend\n\ndirectory '/home/random2/.npm' do\n  owner 'random2'\nend\n\nnpm_package 'Install the grunt package' do\n  path '/home/random2'\n  package 'grunt'\n  json '/home/random2/grunt'\n  user 'random2'\nend\n\nnpm_package 'Install the vary package from a tgz url' do\n  path '/home/random2'\n  package 'vary'\n  json 'https://registry.npmjs.org/vary/-/vary-1.1.2.tgz'\n  user 'random2'\nend\n\ndirectory '/home/random/.npm' do\n  owner 'random'\nend\n\n# Create a package.json file for the test user\ntemplate '/home/random/package.json' do\n  source 'package.json'\n  owner 'random'\n  user 'random'\nend\n\n# Create an .npmrc file for the test user\nfile '/home/random/.npmrc' do\n  content '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'\n  owner 'random'\n  user 'random'\nend\n\n# Test npm_token usage (for NPM private repositories)\nnpm_package 'from_package_json' do\n  path '/home/random'\n  json true\n  user 'random'\n  npm_token '123-abcde'\n  node_env 'staging' # Test node_env usage\nend\n\ndirectory '/home/random1/.npm' do\n  owner 'random1'\nend\n\n# Create an .npmrc file for the test user\nfile '/home/random1/.npmrc' do\n  content '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'\n  owner 'random1'\n  user 'random1'\nend\n\n# Create a package.json file for the test user\ntemplate '/home/random1/package.json' do\n  source 'package.json'\n  owner 'random1'\n  user 'random1'\nend\n\n# Test npm_token usage (for NPM private repositories)\nnpm_package 'from_package_json_private' do\n  path '/home/random1'\n  json true\n  npm_token '123-abcde'\n  options ['--development']\n  node_env 'development'\nend\n"
  },
  {
    "path": "test/cookbooks/test/recipes/resource_win.rb",
    "content": "include_recipe 'nodejs::npm'\ninclude_recipe 'git'\n\nuser 'random' do\n  manage_home true\n  home '/home/random'\nend\n\nuser 'random1' do\n  manage_home true\n  home '/home/random1'\nend\n\nuser 'random2' do\n  manage_home true\n  home '/home/random2'\nend\n\n# global \"express\" using the old resource name\nnodejs_npm 'express'\n\nnpm_package 'async' do\n  version '0.6.2'\nend\n\nnpm_package 'mocha' do\n  options ['--force', '--production']\nend\n"
  },
  {
    "path": "test/cookbooks/test/recipes/source.rb",
    "content": "apt_update 'update'\n\n# Source install puts the npm symlink in /usr/local/bin\nENV['PATH'] = '/usr/local/bin:' + ENV['PATH']\n\nnode.default['nodejs']['install_method'] = 'source'\ninclude_recipe 'nodejs::default'\ninclude_recipe 'test::resource'\n"
  },
  {
    "path": "test/cookbooks/test/recipes/source_iojs.rb",
    "content": "apt_update 'update'\n\nnode.default['nodejs']['engine'] = 'iojs'\nnode.default['nodejs']['install_method'] = 'source'\nnode.default['nodejs']['source']['checksum'] = '55e79cc4f4cde41f03c1e204d2af5ee4b6e4edcf14defc82e518436e939195fa'\nnode.default['nodejs']['version'] = '2.2.1'\n\ninclude_recipe 'nodejs::default'\n"
  },
  {
    "path": "test/cookbooks/test/templates/package.json",
    "content": "{\n  \"name\": \"random-test\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Just some random test\",\n  \"license\": \"MIT\",\n  \"author\": {\n    \"name\": \"Random\"\n  },\n  \"engines\": {\n    \"node\": \">=0.10.0\"\n  },\n  \"dependencies\": {\n    \"config\": \"^3.3.7\",\n    \"koa\": \"^2.13.4\"\n  },\n  \"devDependencies\": {\n    \"gulp\": \"^4.0.2\"\n  },\n  \"scripts\": {\n    \"postinstall\": \"touch $NODE_ENV\"\n  }\n}\n"
  },
  {
    "path": "test/integration/chocolatey/default.rb",
    "content": "control 'commands should exist' do\n  describe command('node -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npm -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npm list -json -global') do\n    its('stdout') { should match(/express/) }\n    its('stdout') { should match(/async@0.6.2/) }\n    its('stdout') { should match(/request/) }\n    its('stdout') { should match(/mocha/) }\n  end\nend\n"
  },
  {
    "path": "test/integration/default/default_spec.rb",
    "content": "os_family = os.family\n\ncontrol 'commands should exist' do\n  describe command('node -v') do\n    its('exit_status') { should eq 0 }\n    # No upstream repository so it installs the OS version\n    unless os_family == 'suse'\n      its('stdout') { should match /^v17\\.*/ }\n    end\n  end\n\n  describe command('npm -v') do\n    its('exit_status') { should eq 0 }\n    # No upstream repository so it installs the OS version\n    unless os_family == 'suse'\n      its('stdout') { should match /^8\\.*/ }\n    end\n  end\n\n  describe command('npx -v') do\n    its('exit_status') { should eq 0 }\n    # No upstream repository so it installs the OS version\n    unless os_family == 'suse'\n      its('stdout') { should match /^8\\.*/ }\n    end\n  end\n\n  describe command('npm list -json -global') do\n    its('stdout') { should_not match(/\"express\"/) }\n    its('stdout') { should match(/\"socket.io\"/) }\n  end\nend\n"
  },
  {
    "path": "test/integration/npm_embedded/default_spec.rb",
    "content": "\ncontrol 'commands should exist' do\n  describe command('node -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npm -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npx -v') do\n    its('exit_status') { should eq 0 }\n  end\nend\n"
  },
  {
    "path": "test/integration/npm_source/default_spec.rb",
    "content": "\ncontrol 'commands should exist' do\n  describe command('node -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npm -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npx -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe file('/usr/local/bin/npm') do\n    it { should exist }\n  end\n\n  describe file('/usr/local/bin/npx') do\n    it { should exist }\n  end\nend\n"
  },
  {
    "path": "test/integration/options/default_spec.rb",
    "content": "control 'packages should install' do\n  describe package('nodejs') do\n    it { should be_installed }\n  end\n\n  describe package('acpid') do\n    it { should be_installed }\n  end\n\n  describe package('adcli') do\n    it { should_not be_installed }\n  end\nend\n"
  },
  {
    "path": "test/integration/package/default.rb",
    "content": "control 'commands should exist' do\n  describe command('node -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npm -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe file '/home/random/staging' do\n    it { should exist }\n  end\n\n  describe command('npm list -json -global') do\n    its('stdout') { should match(/express/) }\n    its('stdout') { should match(/\"async\": {\\n\\s*\"version\": \"0.6.2\"/) }\n    its('stdout') { should match(/request/) }\n    its('stdout') { should match(/mocha/) }\n  end\n\n  describe command('npm list xss -json -global') do\n    its('stdout') { should match(/\"version\":\\s*\"1.0.7\"/) }\n  end\n\n  describe command('npm list minify -json -global') do\n    its('stdout') { should_not match(/\"version\":\\s*\"5.2.0\"/) }\n  end\n\n  describe command('export NPM_TOKEN=\"123-abcde\" && cd /home/random && npm list -json') do\n    its('stdout') { should match(/koa/) }\n    its('stdout') { should match(/gulp/) }\n  end\n\n  describe command('export NPM_TOKEN=\"123-abcde\" && cd /home/random1 && npm list -json') do\n    its('stdout') { should match(/koa/) }\n    its('stdout') { should match(/gulp/) }\n  end\n\n  describe command('export NPM_TOKEN=\"123-abcde\" && cd /home/random2 && npm list -json') do\n    its('stdout') { should match(/grunt/) }\n    its('stdout') { should match(/vary/) }\n  end\nend\n"
  },
  {
    "path": "test/integration/source/default.rb",
    "content": "control 'commands should exist' do\n  describe command('node -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe command('npm -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe file '/home/random/staging' do\n    it { should exist }\n  end\n\n  describe command('npx -v') do\n    its('exit_status') { should eq 0 }\n  end\n\n  describe file('/usr/local/bin/npm') do\n    it { should exist }\n  end\n\n  describe file('/usr/local/bin/npx') do\n    it { should exist }\n  end\nend\n"
  }
]