
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
npm install meansjs
也可下载/dist/meansjs.min.js中的文件使用
示列
// ./src/shims-vue.d.ts
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default componen
}
declare module 'meansjs'; // 示列
日常开发中所需要的方法
引入插件库
import meansJs from 'meansjs';
| 1 | means(方法) :wrench: | 功能 :dragon_face: | means(方法) :wrench: | 功能 :dragon_face: | |
|---|---|---|---|---|---|
| 2 | meAscii | ASCII排序 | 16 | meDate | 年月日 |
| 3 | meSort | 排序 | 17 | meTime | 年月日时分秒 |
| 4 | meSortSize | 字符长度排序 | 18 | meUnix | 时间戳 |
| 5 | meCharacterSize | 字符长度 | 19 | meJstype | 判断数据类型 |
| 6 | meDeepClone | 深拷贝 | |||
| 7 | meAntiShake | 防抖 | |||
| 8 | meThrottle | 节流 | |||
| 9 | meDeWeight | 数组去重 | |||
| 10 | meGetUrl | 获取url的值 | |||
| 11 | meTerminal | 终端判断 | |||
| 12 | meToBase64 | 图片链接转为base64 | |||
| 13 | meBase64File | base64转为file文件 | |||
| 14 | meMin | 获取最小值 | |||
| 15 | meMax | 获取最大值 |
示列
const params = {
name:'means',
id:1
};
const meAscii = meansJs.meAscii(params); // id1namemeans
示列
const arr = [
{id:56},{id:98},{id:65}
];
const size = meansJs.meSort(arr,type:'asc',key:'id');
示列
const arr = ['meansjs','js-yyds','我最厉害','zh']
const size = meansJs.meSortSize(arr); // ['zh', 'meansjs', 'js-yyds', '我最厉害']
示列
const size = means.meCharacterSize('meansjs还不错'); // 13
示列
let arr = [{id:1,name:'我不是meansjs'}]
let deep = meansJs.meDeepClone(arr);
deep[0].name = '你不是meansjs,那你是个啥?'
console.log(deep); // name : "你不是meansjs,那你是个啥?"
console.log(arr); // name : "我不是meansjs"
示列
meansJs.meAntiShake(()=>{
console.log('我是meansjs');
},500) // or
meansJs.meAntiShake(()=>{
test() // 方法
},500)
示列
meansJs.meThrottle(()=>{
console.log('我是meansjs');
},500) // or
meansJs.meThrottle(()=>{
test() // 方法
},500)
示列
let arr = [{id:10},{id:10},{id:2},{id:3},{id:2}];
// let arr = [1,2,1,2,3];
const meDeWeight = meansJs.meDeWeight(arr,'id');
示列
meansJs.meGetUrl("http://localhost:8080/#/about?id=12&name='wode'&dsj='dsajk'") // or
meansJs.meGetUrl() // 获取当前页面url的值
示列
meansJs.meTerminal() // or
meansJs.meTerminal()['weixin']
返回参数
ali: false
android: false
gecko: true
iPad: false
iPhone: false
ios: false
mobile: false
presto: false
trident: false
webApp: true
webKit: false
weixin: false
示列
meansJs.meToBase64('https://img0.baidu.com/it/u=2692044174,3628684553&fm=253&fmt=auto&app=138&f=JPEG?w=450&h=780',(base64)=>{
console.log(base64);
this.base64 = base64;
},0.82,'png',)
示列
meansJs.meToBase64('https://img0.baidu.com/it/u=2692044174,3628684553&fm=253&fmt=auto&app=138&f=JPEG?w=450&h=780',(base64)=>{
const file = meansJs.meBase64File(base64,'meansjs');
console.log(file);
},0.82,'png',)
示列
const arr = [
{id:12},{id:45},{id:6}
];
const size = meansJs.meMin(arr,'id'); // 6 or
const arr = [12,45,2,34,5,3];
const size = meansJs.meMin(arr); // 2
示列
const arr = [
{id:12},{id:45},{id:6}
];
const size = meansJs.meMax(arr,'id'); // 45 or
const arr = [12,45,2,34,5,3];
const size = meansJs.meMax(arr); // 45
示列
const date = meansJs.meDate();
console.log(date); // 2023-01-06
示列
const time = meansJs.meTime();
console.log(time); // 2023-01-06 16:16:58
示列
const unix = meansJs.meUnix();
console.log(unix); // 1672993084067
示列
// let b = '123'; // String
// let b = 12; // Number
// let b = true; // Boolean
// let b = {id:'sda',name:'dsa'}; // Object
// let b = [{id:1},{id:2}]; // Array
// let b = null; // Null
let b = undefined; // Undefined
// let b = function() {}; // Function
// let b = new Date(); // Date
// let b = Symbol(1); // Symbol
const type = meansJs.meJstype(b,true);
console.log(type); //
FAQs
Common methods used in daily development
We found that meansjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.