How to use the snyk/lib/user-config.set function in snyk

To help you get started, we’ve selected a few snyk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MitocGroup / recink / components / snyk / src / snyk-component.js View on Github external
teardown(emitter) {
    if (!this.isActive) {
      return Promise.resolve();
    }
    
    const token = this.container.get('token', '');
    const dev = this.container.get('dev', false);
    const actionable = this.container.get('actionable', true);
    const options = {
      dev, json: true,
      'show-vulnerable-paths': actionable ? 'true' : 'false',
    };
    
    snykUserConfig.set('api', token);
    
    return Promise.all(
      this._modules.map(args => {
        const [ npmModule, emitModule ] = args;
        
        return snykTest(npmModule.rootDir, options)
          .then(result => this._createReport(npmModule, emitModule, result, options))
          .catch(error => this._createReport(npmModule, emitModule, error, options))
      })
    );
  }

snyk

snyk library and cli utility

Apache-2.0
Latest version published 2 days ago

Package Health Score

76 / 100
Full package analysis