String Deduplicator Sample Project
See the live code here
This is an example of progress I've made in Node.js development with modern packaging, testing, and data flow.
The code is written in ES6 syntax via Babel, and packaged with the webpack module bundler.
Tests are written in the Mocha framework with Chai assertions.
Relevant files and directories, not a complete list.
.babelrc used by mocha to determine Babel configuration build/ compiled package for the web, via webpack index.html web ux for the algorithm package.json configuration for dependencies, running tests, etc. src/ actions.js Redux actions used by containers components/ React components to build the UX containers/ Redux containers built from components lib/ deduplicate.js our actual algorithm generate.js generates a list of emails with 50% duplicates index.js React application entry point reducers.js Redux action reducers used by the store test/ Mocha tests webpack.config.js instructs webpack on how to build the bundle
Building the Application
- enter the directory
- bring in the npm packages, check for errors before proceeding
- build the webpack bundle either from globally installed webpack
webpackor from the node_modules directory
- open the index.html file in your web browser
All tests can be run at once, or individual test sets can be selected via package.json and Mocha config. Execution:
- all tests
- algorithm validation
npm run test-deduplicate-validation
- algorithm duration
npm run test-deduplicate-runtime