rand-user-agent 1.0.34 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/data/user-agents.json +1 -1
- package/example/example.js +3 -3
- package/package.json +3 -2
- package/src/index.js +21 -4
- package/src/update-user-agents.js +6 -0
package/README.md
CHANGED
|
@@ -22,6 +22,16 @@ console.log(agent);
|
|
|
22
22
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
You can also provide a browser and an operating system in the parameters of randUserAgent in order to filter out the user agents:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
const randUserAgent = require('rand-user-agent');
|
|
29
|
+
const agent = randUserAgent("desktop", "chrome", "linux");
|
|
30
|
+
|
|
31
|
+
console.log(agent);
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
|
|
25
35
|
## How does it work
|
|
26
36
|
|
|
27
37
|
Using our own database with data about guests and their user-agent, we update a file called "user-agents.json" on a weekly basis with new information.
|