npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bigonion-kit

v0.12.6

Published

A useful web console kit

Downloads

58

Readme

Onion 的 dev-kit

NPM version license

下载(Download)

npm i bigonion-kit

简介(Introduction)

本 NPM 包提供了
This NPM package provides

  • moveIt
  • findId
  • findClass
  • setCookie
  • getCookie
  • log
  • sleep
  • addStyle
  • removeAddedStyle
  • sound2Word
  • getUUID
  • ajax
  • isFocus 常用方法(未完待续...)

支持 umd,web 请使用 umd 来导入(Support umd, please use umd to import web)

eg:

<script src="https://cdn.jsdelivr.net/npm/bigonion-kit/umd/umd-kit.min.js"></script>

ES6 导入

<script type="module">
  import kit from "https://cdn.jsdelivr.net/npm/bigonion-kit/index.min.mjs";
  window.kit = kit; window.moveIt = kit.moveIt; window.findId = kit.findId;
  window.findClass = kit.findClass; window.setCookie = kit.setCookie;
  window.getCookie = kit.getCookie; window.log = kit.log; window.sleep =
  kit.sleep; window.version=kit.version;
</script>

Nodejs

import kit from "bigonion-kit";

或 commonJS 规范

const kit = require("bigonion-kit/umd/umd-kit.js");

来快速导入

函数详情 (Function details)

web 已经挂载全局变量,可以直接输入kit来查看已有的函数 也可以直接控制台输入

log("你好");

来使用

sleep

Eg:

/**
 * fast pause some time, just like delay function
 * @param {int} time
 * @return {Promise}
 * @public
 */

sleep(3000).then(() => {
  log("你已经成功导入devKit");
});

log

Eg:

/**
 * fast log sth...
 * @param {string} a
 * @public
 */

log("Nihao");

findId

Eg:

/**
 * fast find Element by Id
 * @param {string} id
 * @return {Object}
 * @public
 */

findId("id");

findClass

Eg:

/**
 * fast find Element by className
 * @param {string} className
 * @return {Array}
 * @public
 */

findClass("className");

moveIt

Eg:

/**
 * fast move Sth by holding on "controlEle" to move "movedEle"
 * @param {Object} controlEle
 * @param {Object} movedEle
 * @public
 */
controlEle = findId("controlEle");
movedEle = findId("movedEle");
moveIt(controlEle, movedEle);

setCookie

Eg:

/**
 * fast set cookie by Native function
 * @param {string} cname
 * @param {Any} cvalue
 * @param {int} exdays {days}
 * @public
 */

setCookie("cookieName", "cookieValue", 30);

getCookie

Eg:

/**
 * fast get cookie value
 * @param {string} cname
 * @return {string} cvalue
 * @public
 */

getCookie("cookieName");

setClipBoard

Eg:

/**
 * fast get cookie value
 * @param {string} text
 * @public
 */

setClipBoard("你好");

isFocus

/**
 * Judge whether an element is in focus
 * @param {object} element
 * @return {boolean}
 * @public
 */

isFocus(element);

ajax

/**
 * fast send request with ajax
 * @param {string} url
 * @param {string} way
 * @param {boolean} async
 * @param {JSON} header
 * @param {function} onload
 * @return {Object}
 * @public
 */
ajax({
  url: "https://example.com",
  way: "GET",
  async: true,
  header: { "content-type": "json" },
  onload: (data) => {
    console.log(data.response);
  },
});
//注意:不能跨域

getUUID

Eg:

/**
 * fast get cookie value
 * @return {string}
 * @public
 */
kit.getUUID();

sound2Word

Eg:

/**
 * 控制台快捷语音识别
 * @return {string}
 */

kit.sound2Word();

addStyle

Eg:

/**
 * add some style
 * @param {string}
 */
kit.addStyle(`
body{
    background:pink
    }
`);

removeAddedStyle

Eg:

/**
 * remove all the added Cssstyle
 */
kit.removeAddedStyle();

版本更新日志(Version update log)

v0.4.x demo Ver
v0.5.3 增加了 esm 和 umd 模块
v0.7.4 增加了 isFocus、ajax、setClipboard、getUUID
v0.8.4 增加了 addStyle、removeAddedStyle
v0.9.8 原型链方法增加 move

开源协议(Open source agreement)

MIT

作者(Author)

bigonion

nameSpace:
bigonion.cn
md.bigonion.cn ai.bigonion.cn Email: [email protected] && [email protected]

声明:未经本人同意,禁止转载、搬运、抄袭!