├── .gitignore ├── .jshintrc ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── dynamodb ├── config.json ├── installer.js ├── starter.js └── utils.js ├── index.js ├── package-lock.json ├── package.json └── test └── index.test.js /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dynamodb/bin 3 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "esnext": true 4 | } 5 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ashanf@99x.lk. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 99X Technology 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | dynamodb-localhost 2 | ================================= 3 | [![Join the chat at https://gitter.im/99xt/dynamodb-localhost](https://badges.gitter.im/99xt/dynamodb-localhost.svg)](https://gitter.im/99xt/dynamodb-localhost?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 4 | [![npm version](https://badge.fury.io/js/dynamodb-localhost.svg)](https://badge.fury.io/js/dynamodb-localhost) 5 | [![license](https://img.shields.io/npm/l/dynamodb-localhost.svg)](https://www.npmjs.com/package/dynamodb-localhost) 6 | 7 | This library works as a wrapper for AWS DynamoDB Local, intended for use in devops. This library is capable of downloading and installing the DynamoDB Local with a simple set of commands, and pass optional attributes defined in ['DynamoDB Local Documentation'](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html). 8 | 9 | ## This Plugin Requires 10 | 11 | * Java Runtime Engine (JRE) version 6.x or newer 12 | 13 | ## Features 14 | 15 | * Method to Download/Install DynamoDB Local 16 | * Remove/Uninstall DynamoDB Local 17 | * Start/Restart DynamoDB Local with all the options givne in http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html 18 | * Stop individual instances of DynamoDb Local running 19 | 20 | ## Installation 21 | 22 | `npm install --save dynamodb-localhost` 23 | 24 | ## Usage 25 | 26 | Usage example 27 | 28 | ``` 29 | var dynamodbLocal = require("dynamodb-localhost"); 30 | dynamodbLocal.install(); /* This is one time operation. Safe to execute multiple times which installs DynamoDB once. All the other methods depends on this. */ 31 | dynamodbLocal.start({port: 8000}); 32 | ``` 33 | 34 | Supported methods 35 | 36 | ``` 37 | install(callback) To install DynamoDB Local for usage (This is one time operation unless execute remove). 'callback' function is called after installation completes (or if already installed, immediately) 38 | start(options) To start an instance of DynamoDB Local. More information about options shown in the coming section 39 | stop(port) To stop particular instance of DynamoDb Local running on an specified port 40 | remove(callback) To remove DynamoDB Local instance. 'callback' function is called after removal complete. 41 | ``` 42 | 43 | NOTE: After executing start(options), DynamoDB will process incoming requests until you stop it. To stop DynamoDB, type Ctrl+C in the command prompt window. To view dynamodb interactive web shell, go to DynamoDB Local [shell](http://localhost:8000/shell) in your browser. 44 | 45 | All options for DynamoDB start: 46 | 47 | ```js 48 | { port : 8000, /* Port to listen on. Default: 8000 */ 49 | cors : '*', /* Enable CORS support (cross-origin resource sharing) for JavaScript. You must provide a comma-separated "allow" list of specific domains. The default setting for cors is an asterisk (*), which allows public access. */ 50 | inMemory : true, /* DynamoDB; will run in memory, instead of using a database file. When you stop DynamoDB;, none of the data will be saved. Note that you cannot specify both dbPath and inMemory at once. */ 51 | dbPath : '/', /* The directory where DynamoDB will write its database file. If you do not specify this option, the file will be written to the current directory. Note that you cannot specify both dbPath and inMemory at once. For the path, current working directory is /node_modules/dynamodb-localhost/dynamob. For example to create /node_modules/dynamodb-localhost/dynamob/ you should specify '/' with a forwardslash at the end. */ 52 | sharedDb : true, /* DynamoDB will use a single database file, instead of using separate files for each credential and region. If you specify sharedDb, all DynamoDB clients will interact with the same set of tables regardless of their region and credential configuration. */ 53 | delayTransientStatuses : true, /* Causes DynamoDB to introduce delays for certain operations. DynamoDB can perform some tasks almost instantaneously, such as create/update/delete operations on tables and indexes; however, the actual DynamoDB service requires more time for these tasks. Setting this parameter helps DynamoDB simulate the behavior of the Amazon DynamoDB web service more closely. (Currently, this parameter introduces delays only for global secondary indexes that are in either CREATING or DELETING status.) */ 54 | optimizeDbBeforeStartup : true, /* Optimizes the underlying database tables before starting up DynamoDB on your computer. You must also specify -dbPath when you use this parameter. */ 55 | heapInitial: undefined, /* A string which sets the initial heap size e.g., heapInitial: '2048m'. This is input to the java -Xms argument */ 56 | heapMax: undefined, /* A string which sets the maximum heap size e.g., heapMax: '1g'. This is input to the java -Xmx argument */ 57 | ``` 58 | 59 | ## Links 60 | 61 | * [Dynamodb local documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html) 62 | * [Contact Us](mailto:ashanf@99x.lk) 63 | * [NPM Registry](https://www.npmjs.com/package/dynamodb-localhost) 64 | 65 | ## Contributing 66 | 67 | We love our contributors! If you'd like to contribute to the project, feel free to submit a PR. But please keep in mind the following guidelines: 68 | 69 | * Propose your changes before you start working on a PR. You can reach us by submitting a Github issue. This is just to make sure that no one else is working on the same change, and to figure out the best way to solve the issue. 70 | * If you're out of ideas, but still want to contribute, help us in solving Github issues already verified. 71 | * Contributions are not just PRs! We'd be grateful for having you, and if you could provide some support for new comers, that be great! You can also do that by answering this plugin related questions on Stackoverflow. 72 | You can also contribute by writing. Feel free to let us know if you want to publish a useful guides, improve the documentation (attributed to you, thank you!) that you feel will help the community. 73 | 74 | ## Credits 75 | 76 | Bunch of thanks to doapp-ryanp who started [dynamodb-local](https://github.com/doapp-ryanp/dynamodb-local) project -------------------------------------------------------------------------------- /dynamodb/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "setup": { 3 | "download_url": "https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz", 4 | "install_path": "bin", 5 | "jar": "DynamoDBLocal.jar" 6 | }, 7 | "start": { 8 | "port": 8000 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /dynamodb/installer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var tar = require("tar"), 4 | zlib = require("zlib"), 5 | path = require("path"), 6 | https = require("https"), 7 | fs = require("fs"), 8 | ProgressBar = require("progress"), 9 | utils = require("./utils"); 10 | 11 | var download = function(downloadUrl, installPath, callback) { 12 | console.log( 13 | `Started downloading dynamodb-local from ${downloadUrl} into ${installPath}. Process may take few minutes.` 14 | ); 15 | https 16 | .get(downloadUrl, function(response) { 17 | var len = parseInt(response.headers["content-length"], 10), 18 | bar = new ProgressBar( 19 | "Downloading dynamodb-local [:bar] :percent :etas", 20 | { 21 | complete: "=", 22 | incomplete: " ", 23 | width: 40, 24 | total: len 25 | } 26 | ); 27 | 28 | if (200 != response.statusCode) { 29 | throw new Error( 30 | "Error getting DynamoDb local latest tar.gz location " + 31 | response.headers.location + 32 | ": " + 33 | response.statusCode 34 | ); 35 | } 36 | 37 | response 38 | .pipe(zlib.Unzip()) 39 | .pipe( 40 | tar.x({ 41 | C: installPath 42 | }) 43 | ) 44 | .on("data", function(chunk) { 45 | bar.tick(chunk.length); 46 | }) 47 | .on("end", function() { 48 | callback("\n Installation complete!"); 49 | }) 50 | .on("error", function(err) { 51 | throw new Error("Error in downloading Dynamodb local " + err); 52 | }); 53 | }) 54 | .on("error", function(err) { 55 | throw new Error("Error in downloading Dynamodb local " + err); 56 | }); 57 | }; 58 | 59 | var install = function(config, callback) { 60 | var install_path = utils.absPath(config.setup.install_path), 61 | jar = config.setup.jar, 62 | download_url = config.setup.download_url; 63 | 64 | try { 65 | if (fs.existsSync(path.join(install_path, jar))) { 66 | callback("Dynamodb is already installed on path!"); 67 | } else { 68 | utils.createDir(config.setup.install_path); 69 | download(download_url, install_path, callback); 70 | } 71 | } catch (err) { 72 | throw new Error("Error configuring or installing Dynamodb local " + err); 73 | } 74 | }; 75 | module.exports.install = install; 76 | -------------------------------------------------------------------------------- /dynamodb/starter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var spawn = require('child_process').spawn, 4 | utils = require('./utils'); 5 | 6 | var starter = { 7 | start: function (options, config) { 8 | /* Dynamodb local documentation http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html */ 9 | var preArgs = [], 10 | additionalArgs = [], 11 | port = options.port || config.start.port, 12 | db_dir = options.install_path || utils.absPath(config.setup.install_path), 13 | jar = config.setup.jar; 14 | 15 | if (options.heapInitial) { 16 | preArgs.push(`-Xms${options.heapInitial}`); 17 | } 18 | if (options.heapMax) { 19 | preArgs.push(`-Xmx${options.heapMax}`); 20 | } 21 | if (options.dbPath) { 22 | additionalArgs.push('-dbPath', options.dbPath); 23 | } else { 24 | additionalArgs.push('-inMemory'); 25 | } 26 | if (options.sharedDb) { 27 | additionalArgs.push('-sharedDb'); 28 | } 29 | if (options.cors) { 30 | additionalArgs.push('-cors', options.cors); 31 | } 32 | if (options.delayTransientStatuses) { 33 | additionalArgs.push('-delayTransientStatuses'); 34 | } 35 | if (options.optimizeDbBeforeStartup) { 36 | additionalArgs.push('-optimizeDbBeforeStartup'); 37 | } 38 | if (options.help) { 39 | additionalArgs.push('-help'); 40 | } 41 | 42 | var args = ['-jar', jar, '-port', port]; 43 | var executable; 44 | var cwd; 45 | 46 | if (options.docker) { 47 | executable = process.env.DOCKER_PATH || 'docker'; 48 | preArgs = ['run', '-d', '-p', port + ':' + port, process.env.DOCKER_IMAGE || 'amazon/dynamodb-local']; 49 | } else { 50 | executable = 'java'; 51 | preArgs.push('-Djava.library.path=' + db_dir + '/DynamoDBLocal_lib'); 52 | cwd = db_dir; 53 | } 54 | 55 | args = preArgs.concat(args.concat(additionalArgs)); 56 | var child = spawn(executable, args, { 57 | cwd: cwd, 58 | env: process.env, 59 | stdio: ['pipe', 'pipe', process.stderr] 60 | }); 61 | 62 | if (!child.pid) { 63 | throw new Error('Unable to start DynamoDB Local process! Make sure you have ' + executable + ' executable in your path.'); 64 | } 65 | 66 | child.on('error', function (code) { 67 | throw new Error(code); 68 | }); 69 | 70 | return { 71 | proc: child, 72 | port: port 73 | }; 74 | }, 75 | }; 76 | 77 | module.exports = starter; 78 | -------------------------------------------------------------------------------- /dynamodb/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'), 4 | rimraf = require("rimraf"), 5 | fs = require('fs'); 6 | 7 | var absPath = function (p) { 8 | if (path.isAbsolute(p)) { 9 | return p; 10 | } else { 11 | return path.join(path.dirname(__filename), p); 12 | } 13 | }; 14 | 15 | var removeDir = function (relPath, callback) { 16 | var path = absPath(relPath); 17 | rimraf(path, callback); 18 | }; 19 | 20 | var createDir = function (relPath) { 21 | if (!fs.existsSync(absPath(relPath))) { 22 | fs.mkdirSync(absPath(relPath)); 23 | } 24 | }; 25 | 26 | module.exports = { 27 | absPath: absPath, 28 | removeDir: removeDir, 29 | createDir: createDir 30 | }; 31 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var installer = require('./dynamodb/installer'), 4 | starter = require('./dynamodb/starter'), 5 | utils = require('./dynamodb/utils'), 6 | config = require('./dynamodb/config.json'), 7 | dbInstances = {}; 8 | 9 | var dynamodb = { 10 | install: function(callback, path) { 11 | if (path) { 12 | config.setup.install_path = path; 13 | } 14 | installer.install(config, function(msg) { 15 | console.log(msg); 16 | callback(); 17 | }); 18 | }, 19 | start: function(options) { 20 | var instance = starter.start(options, config); 21 | dbInstances[instance.port] = { 22 | process: instance.proc, 23 | options: options 24 | }; 25 | instance.proc.on('close', function(code) { 26 | if (code !== null && code !== 0) { 27 | console.log('DynamoDB Local failed to start with code', code); 28 | } 29 | }); 30 | console.log('Dynamodb Local Started, Visit: http://localhost:' + (options.port || config.start.port) + '/shell'); 31 | }, 32 | stop: function(port) { 33 | if (dbInstances[port]) { 34 | dbInstances[port].process.kill('SIGKILL'); 35 | delete dbInstances[port]; 36 | } 37 | }, 38 | restart: function(port) { 39 | var options = dbInstances[port].options; 40 | this.stop(port); 41 | this.start(options); 42 | console.log("Successfully restarted dynamodb local on port: " + port); 43 | }, 44 | remove: function(callback) { 45 | utils.removeDir(config.setup.install_path, function() { 46 | console.log("Successfully removed dynamodb local!"); 47 | callback(); 48 | }); 49 | } 50 | }; 51 | module.exports = dynamodb; 52 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dynamodb-localhost", 3 | "version": "0.0.9", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ansi-colors": { 8 | "version": "4.1.1", 9 | "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", 10 | "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" 11 | }, 12 | "ansi-regex": { 13 | "version": "5.0.1", 14 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 15 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" 16 | }, 17 | "ansi-styles": { 18 | "version": "4.3.0", 19 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 20 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 21 | "requires": { 22 | "color-convert": "^2.0.1" 23 | } 24 | }, 25 | "anymatch": { 26 | "version": "3.1.3", 27 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 28 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 29 | "requires": { 30 | "normalize-path": "^3.0.0", 31 | "picomatch": "^2.0.4" 32 | } 33 | }, 34 | "argparse": { 35 | "version": "2.0.1", 36 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 37 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" 38 | }, 39 | "assertion-error": { 40 | "version": "1.1.0", 41 | "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", 42 | "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" 43 | }, 44 | "balanced-match": { 45 | "version": "1.0.0", 46 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 47 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 48 | }, 49 | "binary-extensions": { 50 | "version": "2.2.0", 51 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 52 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" 53 | }, 54 | "brace-expansion": { 55 | "version": "1.1.11", 56 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 57 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 58 | "requires": { 59 | "balanced-match": "^1.0.0", 60 | "concat-map": "0.0.1" 61 | } 62 | }, 63 | "braces": { 64 | "version": "3.0.2", 65 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 66 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 67 | "requires": { 68 | "fill-range": "^7.0.1" 69 | } 70 | }, 71 | "browser-stdout": { 72 | "version": "1.3.1", 73 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 74 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" 75 | }, 76 | "camelcase": { 77 | "version": "6.3.0", 78 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", 79 | "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" 80 | }, 81 | "chai": { 82 | "version": "4.2.0", 83 | "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", 84 | "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", 85 | "requires": { 86 | "assertion-error": "^1.1.0", 87 | "check-error": "^1.0.2", 88 | "deep-eql": "^3.0.1", 89 | "get-func-name": "^2.0.0", 90 | "pathval": "^1.1.0", 91 | "type-detect": "^4.0.5" 92 | } 93 | }, 94 | "chalk": { 95 | "version": "4.1.2", 96 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 97 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 98 | "requires": { 99 | "ansi-styles": "^4.1.0", 100 | "supports-color": "^7.1.0" 101 | }, 102 | "dependencies": { 103 | "supports-color": { 104 | "version": "7.2.0", 105 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 106 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 107 | "requires": { 108 | "has-flag": "^4.0.0" 109 | } 110 | } 111 | } 112 | }, 113 | "check-error": { 114 | "version": "1.0.2", 115 | "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", 116 | "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" 117 | }, 118 | "chokidar": { 119 | "version": "3.5.3", 120 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 121 | "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 122 | "requires": { 123 | "anymatch": "~3.1.2", 124 | "braces": "~3.0.2", 125 | "fsevents": "~2.3.2", 126 | "glob-parent": "~5.1.2", 127 | "is-binary-path": "~2.1.0", 128 | "is-glob": "~4.0.1", 129 | "normalize-path": "~3.0.0", 130 | "readdirp": "~3.6.0" 131 | } 132 | }, 133 | "chownr": { 134 | "version": "1.1.4", 135 | "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", 136 | "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" 137 | }, 138 | "cliui": { 139 | "version": "7.0.4", 140 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", 141 | "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", 142 | "requires": { 143 | "string-width": "^4.2.0", 144 | "strip-ansi": "^6.0.0", 145 | "wrap-ansi": "^7.0.0" 146 | } 147 | }, 148 | "color-convert": { 149 | "version": "2.0.1", 150 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 151 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 152 | "requires": { 153 | "color-name": "~1.1.4" 154 | } 155 | }, 156 | "color-name": { 157 | "version": "1.1.4", 158 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 159 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 160 | }, 161 | "concat-map": { 162 | "version": "0.0.1", 163 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 164 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 165 | }, 166 | "debug": { 167 | "version": "4.3.4", 168 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 169 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 170 | "requires": { 171 | "ms": "2.1.2" 172 | }, 173 | "dependencies": { 174 | "ms": { 175 | "version": "2.1.2", 176 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 177 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 178 | } 179 | } 180 | }, 181 | "decamelize": { 182 | "version": "4.0.0", 183 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", 184 | "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==" 185 | }, 186 | "deep-eql": { 187 | "version": "3.0.1", 188 | "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", 189 | "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", 190 | "requires": { 191 | "type-detect": "^4.0.0" 192 | } 193 | }, 194 | "diff": { 195 | "version": "5.0.0", 196 | "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", 197 | "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==" 198 | }, 199 | "emoji-regex": { 200 | "version": "8.0.0", 201 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 202 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 203 | }, 204 | "escalade": { 205 | "version": "3.1.1", 206 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 207 | "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" 208 | }, 209 | "escape-string-regexp": { 210 | "version": "4.0.0", 211 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 212 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" 213 | }, 214 | "fill-range": { 215 | "version": "7.0.1", 216 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 217 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 218 | "requires": { 219 | "to-regex-range": "^5.0.1" 220 | } 221 | }, 222 | "find-up": { 223 | "version": "5.0.0", 224 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 225 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 226 | "requires": { 227 | "locate-path": "^6.0.0", 228 | "path-exists": "^4.0.0" 229 | } 230 | }, 231 | "flat": { 232 | "version": "5.0.2", 233 | "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", 234 | "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" 235 | }, 236 | "fs-minipass": { 237 | "version": "1.2.7", 238 | "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", 239 | "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", 240 | "requires": { 241 | "minipass": "^2.6.0" 242 | } 243 | }, 244 | "fs.realpath": { 245 | "version": "1.0.0", 246 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 247 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 248 | }, 249 | "fsevents": { 250 | "version": "2.3.2", 251 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 252 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 253 | "optional": true 254 | }, 255 | "get-caller-file": { 256 | "version": "2.0.5", 257 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 258 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" 259 | }, 260 | "get-func-name": { 261 | "version": "2.0.0", 262 | "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", 263 | "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" 264 | }, 265 | "glob": { 266 | "version": "7.1.4", 267 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", 268 | "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", 269 | "requires": { 270 | "fs.realpath": "^1.0.0", 271 | "inflight": "^1.0.4", 272 | "inherits": "2", 273 | "minimatch": "^3.0.4", 274 | "once": "^1.3.0", 275 | "path-is-absolute": "^1.0.0" 276 | } 277 | }, 278 | "glob-parent": { 279 | "version": "5.1.2", 280 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 281 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 282 | "requires": { 283 | "is-glob": "^4.0.1" 284 | } 285 | }, 286 | "has-flag": { 287 | "version": "4.0.0", 288 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 289 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 290 | }, 291 | "he": { 292 | "version": "1.2.0", 293 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 294 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" 295 | }, 296 | "inflight": { 297 | "version": "1.0.6", 298 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 299 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 300 | "requires": { 301 | "once": "^1.3.0", 302 | "wrappy": "1" 303 | } 304 | }, 305 | "inherits": { 306 | "version": "2.0.3", 307 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 308 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 309 | }, 310 | "is-binary-path": { 311 | "version": "2.1.0", 312 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 313 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 314 | "requires": { 315 | "binary-extensions": "^2.0.0" 316 | } 317 | }, 318 | "is-extglob": { 319 | "version": "2.1.1", 320 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 321 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" 322 | }, 323 | "is-fullwidth-code-point": { 324 | "version": "3.0.0", 325 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 326 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" 327 | }, 328 | "is-glob": { 329 | "version": "4.0.3", 330 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 331 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 332 | "requires": { 333 | "is-extglob": "^2.1.1" 334 | } 335 | }, 336 | "is-number": { 337 | "version": "7.0.0", 338 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 339 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" 340 | }, 341 | "is-plain-obj": { 342 | "version": "2.1.0", 343 | "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", 344 | "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" 345 | }, 346 | "is-unicode-supported": { 347 | "version": "0.1.0", 348 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", 349 | "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" 350 | }, 351 | "js-yaml": { 352 | "version": "4.1.0", 353 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 354 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 355 | "requires": { 356 | "argparse": "^2.0.1" 357 | } 358 | }, 359 | "locate-path": { 360 | "version": "6.0.0", 361 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 362 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 363 | "requires": { 364 | "p-locate": "^5.0.0" 365 | } 366 | }, 367 | "log-symbols": { 368 | "version": "4.1.0", 369 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", 370 | "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", 371 | "requires": { 372 | "chalk": "^4.1.0", 373 | "is-unicode-supported": "^0.1.0" 374 | } 375 | }, 376 | "minimatch": { 377 | "version": "3.1.2", 378 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 379 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 380 | "requires": { 381 | "brace-expansion": "^1.1.7" 382 | } 383 | }, 384 | "minipass": { 385 | "version": "2.9.0", 386 | "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", 387 | "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", 388 | "requires": { 389 | "safe-buffer": "^5.1.2", 390 | "yallist": "^3.0.0" 391 | } 392 | }, 393 | "minizlib": { 394 | "version": "1.3.3", 395 | "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", 396 | "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", 397 | "requires": { 398 | "minipass": "^2.9.0" 399 | } 400 | }, 401 | "mkdirp": { 402 | "version": "1.0.4", 403 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", 404 | "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" 405 | }, 406 | "mocha": { 407 | "version": "10.2.0", 408 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", 409 | "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", 410 | "requires": { 411 | "ansi-colors": "4.1.1", 412 | "browser-stdout": "1.3.1", 413 | "chokidar": "3.5.3", 414 | "debug": "4.3.4", 415 | "diff": "5.0.0", 416 | "escape-string-regexp": "4.0.0", 417 | "find-up": "5.0.0", 418 | "glob": "7.2.0", 419 | "he": "1.2.0", 420 | "js-yaml": "4.1.0", 421 | "log-symbols": "4.1.0", 422 | "minimatch": "5.0.1", 423 | "ms": "2.1.3", 424 | "nanoid": "3.3.3", 425 | "serialize-javascript": "6.0.0", 426 | "strip-json-comments": "3.1.1", 427 | "supports-color": "8.1.1", 428 | "workerpool": "6.2.1", 429 | "yargs": "16.2.0", 430 | "yargs-parser": "20.2.4", 431 | "yargs-unparser": "2.0.0" 432 | }, 433 | "dependencies": { 434 | "glob": { 435 | "version": "7.2.0", 436 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 437 | "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 438 | "requires": { 439 | "fs.realpath": "^1.0.0", 440 | "inflight": "^1.0.4", 441 | "inherits": "2", 442 | "minimatch": "^3.0.4", 443 | "once": "^1.3.0", 444 | "path-is-absolute": "^1.0.0" 445 | }, 446 | "dependencies": { 447 | "minimatch": { 448 | "version": "3.1.2", 449 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 450 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 451 | "requires": { 452 | "brace-expansion": "^1.1.7" 453 | } 454 | } 455 | } 456 | }, 457 | "minimatch": { 458 | "version": "5.0.1", 459 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", 460 | "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", 461 | "requires": { 462 | "brace-expansion": "^2.0.1" 463 | }, 464 | "dependencies": { 465 | "brace-expansion": { 466 | "version": "2.0.1", 467 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 468 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 469 | "requires": { 470 | "balanced-match": "^1.0.0" 471 | } 472 | } 473 | } 474 | } 475 | } 476 | }, 477 | "ms": { 478 | "version": "2.1.3", 479 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 480 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 481 | }, 482 | "nanoid": { 483 | "version": "3.3.3", 484 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", 485 | "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==" 486 | }, 487 | "normalize-path": { 488 | "version": "3.0.0", 489 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 490 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" 491 | }, 492 | "once": { 493 | "version": "1.4.0", 494 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 495 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 496 | "requires": { 497 | "wrappy": "1" 498 | } 499 | }, 500 | "p-limit": { 501 | "version": "3.1.0", 502 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 503 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 504 | "requires": { 505 | "yocto-queue": "^0.1.0" 506 | } 507 | }, 508 | "p-locate": { 509 | "version": "5.0.0", 510 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 511 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 512 | "requires": { 513 | "p-limit": "^3.0.2" 514 | } 515 | }, 516 | "path-exists": { 517 | "version": "4.0.0", 518 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 519 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" 520 | }, 521 | "path-is-absolute": { 522 | "version": "1.0.1", 523 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 524 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 525 | }, 526 | "pathval": { 527 | "version": "1.1.1", 528 | "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", 529 | "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" 530 | }, 531 | "picomatch": { 532 | "version": "2.3.1", 533 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 534 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" 535 | }, 536 | "progress": { 537 | "version": "1.1.8", 538 | "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", 539 | "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=" 540 | }, 541 | "randombytes": { 542 | "version": "2.1.0", 543 | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", 544 | "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", 545 | "requires": { 546 | "safe-buffer": "^5.1.0" 547 | } 548 | }, 549 | "readdirp": { 550 | "version": "3.6.0", 551 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 552 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 553 | "requires": { 554 | "picomatch": "^2.2.1" 555 | } 556 | }, 557 | "require-directory": { 558 | "version": "2.1.1", 559 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 560 | "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" 561 | }, 562 | "rimraf": { 563 | "version": "2.6.3", 564 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", 565 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", 566 | "requires": { 567 | "glob": "^7.1.3" 568 | } 569 | }, 570 | "safe-buffer": { 571 | "version": "5.2.1", 572 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 573 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 574 | }, 575 | "serialize-javascript": { 576 | "version": "6.0.0", 577 | "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", 578 | "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", 579 | "requires": { 580 | "randombytes": "^2.1.0" 581 | } 582 | }, 583 | "string-width": { 584 | "version": "4.2.3", 585 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 586 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 587 | "requires": { 588 | "emoji-regex": "^8.0.0", 589 | "is-fullwidth-code-point": "^3.0.0", 590 | "strip-ansi": "^6.0.1" 591 | } 592 | }, 593 | "strip-ansi": { 594 | "version": "6.0.1", 595 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 596 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 597 | "requires": { 598 | "ansi-regex": "^5.0.1" 599 | } 600 | }, 601 | "strip-json-comments": { 602 | "version": "3.1.1", 603 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 604 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" 605 | }, 606 | "supports-color": { 607 | "version": "8.1.1", 608 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", 609 | "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", 610 | "requires": { 611 | "has-flag": "^4.0.0" 612 | } 613 | }, 614 | "tar": { 615 | "version": "4.4.19", 616 | "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", 617 | "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", 618 | "requires": { 619 | "chownr": "^1.1.4", 620 | "fs-minipass": "^1.2.7", 621 | "minipass": "^2.9.0", 622 | "minizlib": "^1.3.3", 623 | "mkdirp": "^0.5.5", 624 | "safe-buffer": "^5.2.1", 625 | "yallist": "^3.1.1" 626 | }, 627 | "dependencies": { 628 | "minimist": { 629 | "version": "1.2.7", 630 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", 631 | "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" 632 | }, 633 | "mkdirp": { 634 | "version": "0.5.6", 635 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", 636 | "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", 637 | "requires": { 638 | "minimist": "^1.2.6" 639 | } 640 | } 641 | } 642 | }, 643 | "to-regex-range": { 644 | "version": "5.0.1", 645 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 646 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 647 | "requires": { 648 | "is-number": "^7.0.0" 649 | } 650 | }, 651 | "type-detect": { 652 | "version": "4.0.8", 653 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", 654 | "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" 655 | }, 656 | "workerpool": { 657 | "version": "6.2.1", 658 | "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", 659 | "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==" 660 | }, 661 | "wrap-ansi": { 662 | "version": "7.0.0", 663 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 664 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 665 | "requires": { 666 | "ansi-styles": "^4.0.0", 667 | "string-width": "^4.1.0", 668 | "strip-ansi": "^6.0.0" 669 | } 670 | }, 671 | "wrappy": { 672 | "version": "1.0.2", 673 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 674 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 675 | }, 676 | "y18n": { 677 | "version": "5.0.8", 678 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 679 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" 680 | }, 681 | "yallist": { 682 | "version": "3.1.1", 683 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", 684 | "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" 685 | }, 686 | "yargs": { 687 | "version": "16.2.0", 688 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", 689 | "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", 690 | "requires": { 691 | "cliui": "^7.0.2", 692 | "escalade": "^3.1.1", 693 | "get-caller-file": "^2.0.5", 694 | "require-directory": "^2.1.1", 695 | "string-width": "^4.2.0", 696 | "y18n": "^5.0.5", 697 | "yargs-parser": "^20.2.2" 698 | } 699 | }, 700 | "yargs-parser": { 701 | "version": "20.2.4", 702 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", 703 | "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==" 704 | }, 705 | "yargs-unparser": { 706 | "version": "2.0.0", 707 | "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", 708 | "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", 709 | "requires": { 710 | "camelcase": "^6.0.0", 711 | "decamelize": "^4.0.0", 712 | "flat": "^5.0.2", 713 | "is-plain-obj": "^2.1.0" 714 | } 715 | }, 716 | "yocto-queue": { 717 | "version": "0.1.0", 718 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 719 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" 720 | } 721 | } 722 | } 723 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dynamodb-localhost", 3 | "version": "0.0.9", 4 | "engines": { 5 | "node": ">=4.0" 6 | }, 7 | "description": "Dynamodb local plugin for devops", 8 | "author": "99xtechnology.com", 9 | "license": "MIT", 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/99xt/dynamodb-localhost" 13 | }, 14 | "keywords": [ 15 | "aws", 16 | "dynamodb", 17 | "dynamo", 18 | "testing", 19 | "development", 20 | "tool", 21 | "local", 22 | "localhost", 23 | "local-dynamodb", 24 | "dynamodb-local", 25 | "dynamodb-localhost" 26 | ], 27 | "main": "index.js", 28 | "scripts": { 29 | "test": "mocha test/*.test.js --reporter spec" 30 | }, 31 | "dependencies": { 32 | "chai": "^4.2.0", 33 | "mkdirp": "^1.0.4", 34 | "mocha": "^10.2.0", 35 | "progress": "^1.1.8", 36 | "rimraf": "^2.6.3", 37 | "tar": "^4.4.19" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/index.test.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const utils = require("../dynamodb/utils"); 3 | const { expect } = require("chai"); 4 | const { install, remove } = require("../index"); 5 | const config = require("../dynamodb/config.json"); 6 | 7 | describe("install", function() { 8 | const installPath = `./dynamodb/${config.setup.install_path}`; 9 | const jarPath = `${installPath}/${config.setup.jar}`; 10 | 11 | it("downloads the jar successfully", function(done) { 12 | this.timeout(10000); // 10 second timeout 13 | 14 | install(function() { 15 | if (fs.existsSync(jarPath)) { 16 | done(); 17 | } 18 | }); 19 | }); 20 | 21 | it("removes the setup files", function(done) { 22 | this.timeout(10000); 23 | 24 | remove(function() { 25 | if (!fs.existsSync(installPath)) { 26 | done(); 27 | } 28 | }); 29 | }); 30 | }); 31 | --------------------------------------------------------------------------------