{"id":22486603,"url":"https://github.com/doug-wade/gulp-snyk","last_synced_at":"2025-08-02T19:32:27.004Z","repository":{"id":12817132,"uuid":"72895385","full_name":"doug-wade/gulp-snyk","owner":"doug-wade","description":"A gulp wrapper for snyk","archived":true,"fork":false,"pushed_at":"2022-03-16T06:03:50.000Z","size":2807,"stargazers_count":9,"open_issues_count":10,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-02T06:04:04.441Z","etag":null,"topics":["dependency-analysis","gulp","snyk"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doug-wade.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-05T00:28:54.000Z","updated_at":"2023-07-24T07:44:10.000Z","dependencies_parsed_at":"2022-08-07T07:00:46.415Z","dependency_job_id":null,"html_url":"https://github.com/doug-wade/gulp-snyk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doug-wade%2Fgulp-snyk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doug-wade%2Fgulp-snyk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doug-wade%2Fgulp-snyk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doug-wade%2Fgulp-snyk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doug-wade","download_url":"https://codeload.github.com/doug-wade/gulp-snyk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228500164,"owners_count":17930002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-analysis","gulp","snyk"],"created_at":"2024-12-06T17:14:58.888Z","updated_at":"2024-12-06T17:15:59.948Z","avatar_url":"https://github.com/doug-wade.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# gulp-snyk [![Build Status](https://travis-ci.org/doug-wade/gulp-snyk.svg?branch=master)](https://travis-ci.org/doug-wade/gulp-snyk) ![appveyor build status](https://ci.appveyor.com/api/projects/status/github/doug-wade/gulp-snyk?branch=master\u0026svg=true) ![codecov status](https://img.shields.io/codecov/c/github/doug-wade/gulp-snyk.svg) [![Known Vulnerabilities](https://snyk.io/test/github/doug-wade/gulp-snyk/badge.svg)](https://snyk.io/test/github/doug-wade/gulp-snyk)\n\n\u003e gulp plugin for using Snyk\n\n\n## Install\n\n```\n$ npm install --save-dev gulp-snyk\n```\n\nOr\n\n```\n$ yarn add --dev gulp-snyk\n```\n\n## Usage\n\nTo only break the build on vulnerabilities, use snyk without any options\n\n```javascript\nconst snyk = require('gulp-snyk');\ngulp.task('protect', function(cb) {\n  return snyk({ command: 'protect' }, cb);\n});\ngulp.task('prepare', 'protect');\n```\n\nA more feature-ful configuration might be\n\n```javascript\nconst snyk = require('gulp-snyk');\ngulp.task('protect', function(cb) {\n  return snyk({ command: 'protect' }, cb);\n});\ngulp.task('auth', function() {\n  return snyk({ command: 'auth' }, cb);\n});\ngulp.task('test', ['auth'], function() {\n  return snyk({ command: 'test' }, cb);\n});\ngulp.task('prepare', 'protect');\n```\n\nNote the dependency on `auth` for the `test` task -- [Snyk now requires authentication](https://snyk.io/blog/requiring-authentication/), so we make sure\nthat the user is logged in before running the test.  You will also need to add a Snyk token\nas an environment variable to your CI server.\n\nAnd then, in your package.json\n\n```javascript\n{\n  \"scripts\": {\n    \"prepublish\": \"gulp prepublish\",\n    \"test\": \"gulp test\"\n  }\n}\n```\n\nYou may also consider adding an npm alias for `gulp auth`.\n\nFor a real-world use-case, check out [the clefs plugin generator](https://github.com/doug-wade/clefs/tree/master/packages/generator-clefs-plugin)\n\n## API\n\n### snyk([options], cb)\n\n#### options\n\nA hash of options to configure snyk.  If this is omitted, then it is the\nequivalent of passing the following options hash.\n\n```javascript\ngulp.task('snyk-test', function(cb) {\n\treturn snyk({command: 'test', directory: process.cwd(), debug: false, options: { dev: true }}, cb);\n});\n```\n\n##### command\n\nType: `string`\u003cbr\u003e\nDefault: `test`\nExample:\n```javascript\ngulp.task('protect', function(cb) {\n\treturn snyk({command: 'protect'}, cb);\n});\n```\n\nOne of the [snyk command-line commands](https://snyk.io/docs/using-snyk/).\nFor instance: auth, test, wizard, protect, monitor, policy.\n\n##### directory\n\nType: `string`\u003cbr\u003e\nDefault: `process.cwd()`\nExample:\n```javascript\ngulp.task('snyk-test', function(cb) {\n\treturn snyk({command: 'test', directory: path.join(process.cwd(), 'packages', 'my-package')}, cb);\n});\n```\n\nThe directory that contains the package on which to run the snyk command.\n\n##### options\n\nType: `object`\u003cbr\u003e\nDefault: `{ dev: true }`\nExample:\n```javascript\ngulp.task('snyk-wizard', function(cb) {\n\treturn snyk({command: 'wizard', options: {help: true}}, cb);\n});\n```\n\nThe options supported by the [snyk command line](https://snyk.io/docs/using-snyk/).\n\n##### debug\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\nExample:\n```javascript\ngulp.task('snyk-help', function(cb) {\n\treturn snyk({command: 'test', debug: true}, cb);\n});\n```\n\nTurns on debug logging\n\n#### cb\n\nThe callback from the asynchronous gulp task, the function passed as the first\nargument to the gulp task callback.  For example:\n\n```javascript\ngulp.task('protect', function(cb) {\n  return snyk({ command: 'protect' }, cb);\n});\n```\n\n## License\n\nMIT © [Doug Wade](http://dougwade.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoug-wade%2Fgulp-snyk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoug-wade%2Fgulp-snyk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoug-wade%2Fgulp-snyk/lists"}