Skip to content
This repository was archived by the owner on May 1, 2023. It is now read-only.

Commit 68da344

Browse files
authored
using umd (#45)
1 parent 0e73321 commit 68da344

File tree

8 files changed

+4111
-68
lines changed

8 files changed

+4111
-68
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
.idea
21
node_modules
2+
umd
3+
.npmrc

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ Finds degree of similarity between two strings, based on [Dice's Coefficient](ht
1919
* [2.0.0](#200)
2020
* [3.0.0](#300)
2121
* [3.0.1](#301)
22+
* [4.0.0](#400)
2223

2324

2425
## Usage
26+
27+
#### For Node.js
28+
2529
Install using:
2630

2731
```shell
@@ -37,9 +41,26 @@ var similarity = stringSimilarity.compareTwoStrings('healed', 'sealed');
3741

3842
var matches = stringSimilarity.findBestMatch('healed', ['edward', 'sealed', 'theatre']);
3943
```
44+
45+
#### For browser apps
46+
47+
Include `<script>//unpkg.com/string-similarity/umd/string-similarity.min.js</script>` to get the latest version.
48+
49+
Or `<script>//unpkg.com/[email protected]/umd/string-similarity.min.js</script>` to get a specific version (3.0.0) in this case.
50+
51+
This exposes a global variable called `stringSimilarity` which you can start using.
52+
53+
```
54+
<script>
55+
stringSimilarity.compareTwoStrings('what!', 'who?');
56+
</script>
57+
```
58+
59+
(The package is exposed as UMD, so you can consume it as such)
60+
4061
## API
4162

42-
Requiring the module gives an object with two methods:
63+
The package contains two methods:
4364

4465
### compareTwoStrings(string1, string2)
4566

@@ -124,5 +145,8 @@ stringSimilarity.findBestMatch('Olive-green table for sale, in extremely good co
124145
* Refactoring: removed unused functions; used `substring` instead of `substr`
125146
* Updated dependencies
126147

148+
### 4.0.0
149+
* Distributing as an UMD build to be used in browsers.
150+
127151
![Build status](https://codeship.com/projects/2aa453d0-0959-0134-8a76-4abcb29fe9b4/status?branch=master)
128152
[![Known Vulnerabilities](https://snyk.io/test/github/aceakash/string-similarity/badge.svg)](https://snyk.io/test/github/aceakash/string-similarity)

0 commit comments

Comments
 (0)