Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
解决前后端模块化共用;面向前端AMDJS模块,支持前端模块在服务端使用;提供模块插件机制;支持自定义路由
beef means that modules from backend to frontend stay works
global.require = require('beef');
// 自定义路由
require.config({
baseUrl: './source',
packages: {
'admin': '../admin'
}
});
// 自定义扩展插件
require.plugin.ext = function (filename) {
return require(filename);
};
// 配置第一次
require.config({
name: 'source',
baseUrl: './source',
packages: {
'resource': './resource'
}
});
// 配置第二次
require.config({
name: 'admin',
baseUrl: './admin',
packages: {
'public': './public'
}
});
使用npm安装beef
npm install beef
// 如果不仅仅当前模块使用,建议暴露为全局对象
global.require = require('beef');
// 同步require 方式
var mod = require('./mod');
// 异步调用方式
require(['./amd'], function(amd) {
console.log(amd);
});
// 利用插件读取
var text = require('text!./text.txt');
console.log(text);
需要用define-function定义模块
define(function(require, exports, module) {
return "mod";
});
module.exports = {
name: 'node-module'
};
FAQs
beef - brwoser end equals framework
We found that beef 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.