mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
parent
0109c76858
commit
8aaf7db771
11
readme.md
11
readme.md
@ -75,6 +75,17 @@ Extract detailed type of web browser, layout engine, operating system, and devic
|
||||
</script>
|
||||
```
|
||||
|
||||
## Using requirejs
|
||||
|
||||
If you're using requirejs, you can load UA-Parser like any other module.
|
||||
|
||||
```js
|
||||
require(['ua-parser'], function(UAParser) {
|
||||
var parser = new UAParser();
|
||||
console.log(parser.getResult());
|
||||
});
|
||||
```
|
||||
|
||||
## Using node.js
|
||||
|
||||
```sh
|
||||
|
@ -417,6 +417,11 @@
|
||||
exports = module.exports = UAParser;
|
||||
}
|
||||
exports.UAParser = UAParser;
|
||||
} else if (typeof define === 'function' && define.amd) {
|
||||
// requirejs env
|
||||
define(function() {
|
||||
return UAParser;
|
||||
});
|
||||
} else {
|
||||
// browser env
|
||||
global.UAParser = UAParser;
|
||||
|
Loading…
x
Reference in New Issue
Block a user