Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ws456999/performance-fmp
get performance timing
https://github.com/ws456999/performance-fmp
Last synced: about 2 months ago
JSON representation
get performance timing
- Host: GitHub
- URL: https://github.com/ws456999/performance-fmp
- Owner: ws456999
- Created: 2020-02-27T13:53:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-13T13:14:58.000Z (about 2 years ago)
- Last Synced: 2023-03-21T04:02:36.571Z (almost 2 years ago)
- Language: TypeScript
- Size: 969 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# performance-fmp
## Introduction
无埋点方式计算页面`PERFORMANCE TIMING`,包括
- PERFORMANCE
- FCP
- FMP
- TTI时间
- domNode meaningful paint timing## install
```shell
npm i performance-fmp --save
```## usage
```
import Performance from 'performance-fmp';// 获取performance数据
Performance.getTiming().then((data) => {
/* data include performance fmp fcp tti etc. */
console.log(data);
});// 添加配置
Performance.getTiming({
duration: 5000; // fmp tti 超时时间设置
}).then((data) => {
/* data include performance fmp fcp tti etc. */
console.log(data);
});// 获取 node meaningful paint timing
Performance.getNodeMP({
duration: 3000,
node: document.querySelector('.app'),
}).then(({fmp}) => {
console.log(fmp)
});```
## Contribution
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.
## License
performance-fmp is available under the [MIT license](https://tldrlegal.com/license/mit-license).