Socket
Socket
Sign inDemoInstall

get-driver-scripts

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-driver-scripts - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

.travis.yml

12

index.js
var getModulesToBuild = require('get-modules-to-build');
var appRoots = require('app-root');
var path = require('path');
var debug = require('debug')('get-driver-scripts');

@@ -17,2 +18,3 @@ var defaultExclusions = [

* @param {String} [options.config] - RequireJS config for aliased paths
* @param {String} [options.webpackConfig] - Webpack config for aliased paths
* @param {String[]} [options.exclusions] - List of directory names to exclude from the search

@@ -26,8 +28,16 @@ */

debug('directory: ' + options.directory);
debug('config: ' + options.config);
debug('webpack config: ' + options.webpackConfig);
debug('exclusions: ' + options.exclusions);
if (options.buildConfig) {
try {
var drivers = getConfigDrivers(options.directory, options.buildConfig);
debug('fetched the following drivers from the build config:\n', drivers);
options.success(null, drivers);
} catch (e) {
debug('error fetching drivers from the build config: ' + e.message);
debug(e.stack);
options.success(e);

@@ -40,2 +50,3 @@ }

config: options.config,
webpackConfig: options.webpackConfig,
ignoreDirectories: defaultExclusions.concat(options.exclusions),

@@ -51,2 +62,3 @@ success: function(roots) {

* Get the driver scripts from a requirejs configuration file
*
* @param {String} directory

@@ -53,0 +65,0 @@ * @param {String} configPath

8

package.json
{
"name": "get-driver-scripts",
"version": "1.0.1",
"version": "1.1.0",
"description": "Get the entry points from a config or found within a directory",

@@ -33,6 +33,6 @@ "main": "index.js",

"dependencies": {
"app-root": "~2.0.1",
"get-modules-to-build": "~1.0.1",
"resolve-dependency-path": "~1.0.1"
"app-root": "~2.0.3",
"debug": "~2.2.0",
"get-modules-to-build": "~1.0.1"
}
}

@@ -1,2 +0,2 @@

#### get-driver-scripts
#### get-driver-scripts [![npm](http://img.shields.io/npm/v/get-driver-scripts.svg)](https://npmjs.org/package/get-driver-scripts) [![npm](http://img.shields.io/npm/dm/get-driver-scripts.svg)](https://npmjs.org/package/get-driver-scripts)

@@ -3,0 +3,0 @@ Gets the entry point filepaths to an application from a build configuration

@@ -6,28 +6,2 @@ var assert = require('assert');

describe('get-driver-scripts', function() {
it('returns the build modules from a requirejs build config', function(done) {
getDrivers({
directory: __dirname + '/example',
buildConfig: __dirname + '/example/build.json',
success: function(err, drivers) {
assert(!err);
assert(drivers.length);
drivers.forEach(function(d) {
assert(fs.existsSync(d));
});
done();
}
});
});
it('returns the found application roots if no config was supplied', function(done) {
getDrivers({
directory: __dirname + '/example',
success: function(err, drivers) {
assert(!err);
assert(drivers.length);
done();
}
});
});
it('throws if the success callback was not given', function() {

@@ -48,2 +22,54 @@ assert.throws(function() {

});
describe('amd', function() {
beforeEach(function() {
this._directory = __dirname + '/example/amd';
});
it('returns the build modules from a requirejs build config', function(done) {
getDrivers({
directory: this._directory,
buildConfig: this._directory + '/build.json',
config: this._directory + '/config.json',
success: function(err, drivers) {
assert(!err);
assert(drivers.length);
drivers.forEach(function(d) {
assert(fs.existsSync(d));
});
done();
}
});
});
it('returns the found application roots if no config was supplied', function(done) {
getDrivers({
directory: this._directory,
config: this._directory + '/config.json',
success: function(err, drivers) {
assert(!err);
assert(drivers.length);
done();
}
});
});
});
describe('commonjs', function() {
beforeEach(function() {
this._directory = __dirname + '/example/commonjs';
});
it('returns the found application roots', function(done) {
getDrivers({
directory: this._directory,
success: function(err, drivers) {
assert.ok(!err);
assert.equal(drivers.length, 1);
assert.equal(drivers[0], this._directory + '/cjsDriver.js');
done();
}.bind(this)
});
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc