Skip to content

Commit

Permalink
docs: style code
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Apr 30, 2020
1 parent 93f9beb commit 3826550
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ browser support for `process.hrtime()`.

## NodeJS
### As a polyfill
```
```js
require('browser-hrtime');

const NS_PER_SEC = 1e9;
Expand All @@ -22,7 +22,7 @@ setTimeout(() => {
}, 1000);
```
### As a function
```
```js
const hrtime = require('browser-hrtime');//if your code will

const NS_PER_SEC = 1e9;
Expand All @@ -38,7 +38,7 @@ Typescript: `"esModuleInterop": true`

## ECMAScript

```
```js
import hrtime from 'browser-hrtime';

const NS_PER_SEC = 1e9;
Expand All @@ -55,7 +55,7 @@ setTimeout(() => {
```

or you can use as polyfill:
```
```js
import 'browser-hrtime';
const NS_PER_SEC = 1e9;
const time = process.hrtime();
Expand All @@ -76,15 +76,15 @@ add to `src/polyfills.ts`:
*You should add @types/node to your Angular app*
`npm i -S @types/node`
Then in `tsconfig.json`
```
```json
"angularCompilerOptions": {
"types" : ["node"]
....
}
```

## Use in browser
```
```html
<!DOCTYPE html>
<html>

Expand Down
1 change: 0 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pkg from './package.json';
import {terser} from "rollup-plugin-terser";
import typescript from 'rollup-plugin-typescript2';
const libraryName = 'browser-detect';

export default {
input: 'src/index.ts',
Expand Down

0 comments on commit 3826550

Please sign in to comment.