1. @hai2007/browser
🌐 基于浏览器开发的常用工具类方法或浏览器相关的操作,比如判断浏览器类型和版本等。
@hai2007/browser
Package: @hai2007/browser
Created by: hai2007
Last modified: Sat, 23 Jul 2022 08:24:23 GMT
Version: 0.4.0
License: MIT
Downloads: 25
Repository: https://github.com/hai2007/browser.js

Install

npm install @hai2007/browser
yarn add @hai2007/browser

browser.js

🌐 基于浏览器开发的常用工具类方法或浏览器相关的操作,比如判断浏览器类型和版本等。

downloads CDN Version License GitHub repo stars

Issues

使用的时候遇到任何问题或有好的建议,请点击进入issue,欢迎参与维护!

How to use?

首先你需要通过命令行安装,就像这样:

npm install --save @hai2007/browser

安装好了以后,然后引入你需要的方法即可(在具体方法的开头会说明),除此之外,你还可以直接引入全部方法:

 import tool from '@hai2007/browser';

 <script src='https://cdn.jsdelivr.net/npm/@hai2007/browser@0'></script>

可以使用的接口

  • browser.formatColor() : 颜色格式化
  • browser.getKeyString() : 获取当前键盘按下的按键
  • ......等

当然,考虑到web应用打包体积的问题,比如我们希望对dom进行操作,我们有browser.xhtml对象,那么,更小提交的引入方式是:

 import xhtml from '@hai2007/browser/xhtml.js';

具体的使用你可以查阅文档哦~

如果在使用的时候,发现文档中有的方法无法使用,可能是你的版本过低导致的,你可以点击此处查看版本日志。

开源协议

MIT

Copyright (c) 2021-present hai2007 走一步,再走一步。

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin