diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index 89973ab..0000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Node CI - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [8.x, 10.x, 12.x] - - steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: npm install, build, and test - run: | - npm install - npm run build --if-present - npm test - env: - CI: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d8c4a79 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Test + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14, 16] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run build --if-present + - run: npm run test diff --git a/README.md b/README.md index 1c5d140..d62931b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Contents -- [Demo](#demo) +- [Demo](https://blueimp.github.io/JavaScript-MD5/) - [Description](#description) - [Usage](#usage) - [Client-side](#client-side) @@ -12,20 +12,23 @@ - [Tests](#tests) - [License](#license) -## Demo - -[JavaScript MD5 Demo](https://blueimp.github.io/JavaScript-MD5/) - ## Description -JavaScript MD5 implementation. Compatible with server-side environments like -Node.js, module loaders like RequireJS, Browserify or webpack and all web -browsers. +JavaScript [MD5](https://en.wikipedia.org/wiki/MD5) implementation. +Compatible with server-side environments like [Node.js](https://nodejs.org/), +module loaders like [RequireJS](https://requirejs.org/) or +[webpack](https://webpack.js.org/) and all web browsers. ## Usage ### Client-side +Install the **blueimp-md5** package with [NPM](https://www.npmjs.org/): + +```sh +npm install blueimp-md5 +``` + Include the (minified) JavaScript [MD5](https://en.wikipedia.org/wiki/MD5) script in your HTML markup: @@ -45,10 +48,9 @@ var hash = md5('value') // "2063c1608d6e0baf80249c42e2be5804" ### Server-side The following is an example how to use the JavaScript MD5 module on the -server-side with [Node.js](http://nodejs.org/). +server-side with [Node.js](https://nodejs.org/). -Create a new directory and add the **md5.js** file. Or alternatively, install -the **blueimp-md5** package with [npm](https://www.npmjs.org/): +Install the **blueimp-md5** package with [NPM](https://www.npmjs.org/): ```sh npm install blueimp-md5 @@ -58,7 +60,7 @@ Add a file **server.js** with the following content: ```js require('http') - .createServer(function(req, res) { + .createServer(function (req, res) { // The md5 module exports the md5() function: var md5 = require('./md5'), // Use the following version if you installed the package with npm: @@ -124,7 +126,7 @@ There are two different ways to run the tests: - run `npm test` in the Terminal in the root path of the repository package. The first one tests the browser integration, the second one the -[node.js](http://nodejs.org/) integration. +[Node.js](https://nodejs.org/) integration. ## License diff --git a/bin/sync-vendor-libs.sh b/bin/sync-vendor-libs.sh new file mode 100755 index 0000000..c2e27d9 --- /dev/null +++ b/bin/sync-vendor-libs.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd "$(dirname "$0")/.." +cp node_modules/chai/chai.js test/vendor/ +cp node_modules/mocha/mocha.js test/vendor/ +cp node_modules/mocha/mocha.css test/vendor/ diff --git a/css/demo.css b/css/demo.css index 4de2265..7cb99b4 100644 --- a/css/demo.css +++ b/css/demo.css @@ -10,54 +10,111 @@ */ body { - max-width: 750px; + max-width: 990px; margin: 0 auto; padding: 1em; - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; - font-size: 1em; - line-height: 1.4em; - background: #222; - color: #fff; + font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', + Arial, sans-serif; -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; + line-height: 1.4; + background: #212121; + color: #dedede; } a { - color: orange; + color: #61afef; text-decoration: none; } -img { - border: 0; - vertical-align: middle; +a:visited { + color: #56b6c2; +} +a:hover { + color: #98c379; } h1 { - line-height: 1em; + margin-top: 0.5em; + margin-bottom: 0.5em; } -textarea, -input { +label { display: inline-block; - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; + margin-bottom: 0.25em; +} +button, +input, +textarea { + -webkit-appearance: none; box-sizing: border-box; - padding: 10px; - margin: 0 0 10px; + margin: 0; + padding: 0.5em 0.75em; + font-family: inherit; + font-size: 100%; + line-height: 1.4; + background: #414141; + color: #dedede; + border: 1px solid #363636; + border-radius: 5px; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.07); +} +input, +textarea { + display: block; + width: 100%; + box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.07); +} +textarea { + display: block; + overflow: auto; +} +button { + background: #3c76a7; + background: linear-gradient(180deg, #3c76a7, #225c8d); + border-color: #225c8d; + color: #fff; +} +button[type='submit'] { + background: #6fa349; + background: linear-gradient(180deg, #6fa349, #568a30); + border-color: #568a30; +} +button[type='reset'] { + background: #d79435; + background: linear-gradient(180deg, #d79435, #be7b1c); + border-color: #be7b1c; +} +button:active { + box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5); +} + +@media (prefers-color-scheme: light) { + body { + background: #ececec; + color: #212121; + } + a { + color: #225c8d; + } + a:visited { + color: #378f9a; + } + a:hover { + color: #6fa349; + } + input, + textarea { + background: #fff; + border-color: #d1d1d1; + color: #212121; + } } -@media (min-width: 481px) { - .navigation { +@media (min-width: 540px) { + #navigation { list-style: none; padding: 0; } - .navigation li { + #navigation li { display: inline-block; } - .navigation li:not(:first-child):before { - content: '| '; + #navigation li:not(:first-child)::before { + content: ' | '; } } - -/* IE7 fixes */ -* + html textarea, -* + html input { - width: 460px; -} diff --git a/index.html b/index.html index 1d0f89e..ff78e15 100644 --- a/index.html +++ b/index.html @@ -31,14 +31,15 @@

JavaScript MD5 Demo

JavaScript MD5 implementation.
Compatible with server-side environments like - Node.js, module loaders like - RequireJS, - Browserify or - webpack and all web browsers. + Node.js, module loaders like + RequireJS or + webpack and all web browsers.

-