{"name":"@snyk/protect","version":"1.1304.2","keywords":["security","vulnerabilities","advisories","audit","snyk","scan","docker","container","scanning"],"author":{"name":"snyk.io"},"license":"Apache-2.0","_id":"@snyk/protect@1.1304.2","maintainers":[{"name":"snyk-admin","email":"npmjs+snyk-admin@snyk.io"}],"homepage":"https://github.com/snyk/snyk#readme","bugs":{"url":"https://github.com/snyk/snyk/issues"},"bin":{"snyk-protect":"bin/snyk-protect"},"dist":{"shasum":"a142df7fd0a86335b0f0983cf7e44b44fa9fa2f4","tarball":"http://registry-npm.ywwl.com/@snyk/protect/download/@snyk/protect-1.1304.2.tgz","fileCount":37,"integrity":"sha512-0kYSSdfNa7Xua4qYvVU20zkyzCRvTdcGiOHuR9KnQk5LnBx9+blK/NtFK2Qup268QeTIFpCw1KMoynIShSZ9Aw==","signatures":[{"sig":"MEQCID3pzeICaVqRZp5lY2MTt6zLe3VNAVJXAku0dWWLwK67AiAB1CeieWIQ2jCEIP9unbwdfybxorOoL7293PJJsjhXIw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47812,"size":14083,"noattachment":false,"key":"/@snyk/protect/-/@snyk/protect-1.1304.2.tgz"},"main":"./dist/index.js","_from":"file:binary-releases/snyk-protect.tgz","types":"./dist/index.d.ts","engines":{"node":">=10"},"scripts":{"test":"npm run test:unit && npm run test:acceptance","build":"tsc","format":"prettier --write '{src,test,scripts}/**/*.{js,ts}'","test:unit":"jest \"/test/unit/((.+)/)*[^/]+\\.spec\\.ts\"","test:smoke":"jest \"/test/acceptance/((.+)/)*[^/]+\\.smoke\\.spec\\.ts\"","test:acceptance":"jest \"/test/acceptance/((.+)/)*[^/]+\\.spec\\.ts\""},"_npmUser":{"name":"snyk-admin","email":"npmjs+snyk-admin@snyk.io"},"_resolved":"/home/circleci/project/binary-releases/snyk-protect.tgz","_integrity":"sha512-0kYSSdfNa7Xua4qYvVU20zkyzCRvTdcGiOHuR9KnQk5LnBx9+blK/NtFK2Qup268QeTIFpCw1KMoynIShSZ9Aw==","repository":{"url":"git+https://github.com/snyk/snyk.git","type":"git"},"_npmVersion":"10.8.2","description":"Snyk protect library and utility","directories":{"lib":"src","test":"test"},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"fs-extra":"^9.1.0","cross-spawn":"^6.0.5"},"_npmOperationalInternal":{"tmp":"tmp/protect_1.1304.2_1778076088994_0.6841920225760345","host":"s3://npm-registry-packages-npm-production"},"readme":"# @snyk/protect\n\n[![npm](https://img.shields.io/npm/v/@snyk/protect)](https://www.npmjs.com/package/@snyk/protect)\n[![Known Vulnerabilities](https://snyk.io/test/github/snyk/snyk/badge.svg)](https://snyk.io/test/github/snyk/snyk)\n\n![Snyk](https://snyk.io/style/asset/logo/snyk-print.svg)\n\nPatch vulnerable code in your project's dependencies. This package is officially maintained by [Snyk](https://snyk.io).\n\n## Usage\n\nYou don't typically need to add the @snyk/protect dependency manually. It'll be introduced when it's needed as part of [Snyk's Fix PR service](https://support.snyk.io/hc/en-us/articles/360011484018-Fixing-vulnerabilities).\n\nTo enable patches in your Fix PRs:\n\n- Visit https://app.snyk.io\n- Go to \"Org Settings\" > \"Integrations\"\n- Choose \"Edit Settings\" under your SCM integration.\n- Under the \"Fix Pull Request\" section, ensure patches are enabled.\n\nSnyk will now include patches as part of its Fix PRs for your project.\n\n## How it works\n\nIf there's a patch available for a vulnerability in your project, the Fix PR:\n\n- Adds a `patch` entry to your `.snyk` file.\n- Adds `@snyk/protect` to your `package.json`'s dependencies.\n- Adds `@snyk/protect` to your `package.json`'s [`prepare` script](https://docs.npmjs.com/cli/v7/using-npm/scripts).\n\n```patch\n {\n   \"name\": \"my-project\",\n   \"scripts\": {\n+    \"prepare\": \"npm run snyk-protect\",\n+    \"snyk-protect\": \"snyk-protect\"\n   },\n   \"dependencies\": {\n+    \"@snyk/protect\": \"^1.657.0\"\n   }\n }\n```\n\nNow after you run npm install, @snyk/protect will automatically download each patch configured in your .snyk file and apply them to your installed dependencies.\n\n## Migrating from `snyk protect` to `@snyk/protect`\n\n`@snyk/protect` is a standalone replacement for `snyk protect`. They both do the same job, however:\n\n- `@snyk/protect` has zero dependencies.\n- You don't need to include `snyk` in your dependencies (which is a much larger package with many dependencies).\n\nIf you already have Snyk Protect set up, you can migrate to `@snyk/protect` by applying the following changes to your `package.json`:\n\n```patch\n {\n   \"name\": \"my-project\",\n   \"scripts\": {\n     \"prepare\": \"npm run snyk-protect\",\n-    \"snyk-protect\": \"snyk protect\"\n+    \"snyk-protect\": \"snyk-protect\"\n   },\n   \"dependencies\": {\n-    \"snyk\": \"^1.500.0\"\n+    \"@snyk/protect\": \"^1.657.0\"\n   }\n }\n```\n\nWe have also created the [@snyk/cli-protect-upgrade](https://www.npmjs.com/package/@snyk/cli-protect-upgrade) npx script which you can use to update your project automatically. To use it, `cd` to the location containing the package.json to be updated and run:\n\n```\nnpx @snyk/cli-protect-upgrade\n```\n\n---\n\nMade with 💜 by Snyk\n","publish_time":1778076089144,"_cnpm_publish_time":1778076089144,"dist-tags":{"hammertest":"1.0.0-dev-f8b64f76b9eead9e87f1accc9eff1e1c1de7ab6c","latest":"1.1308.4","preview":"1.1309.0-preview.e55d83898248a6acb4a9929424b496a3091bb4ee","rc":"1.1308.4-rc.17c0a6d79eaf9fd572d15e091ed4e45d8b4864ca"}}