
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
基于
thinkjs 2.x
方便的使用localstorage存放静态资源,思路点这里:设计localStorage更新
npm install think-ls
// middleware.js里注册
import ls from 'think-ls';
think.middleware('think-ls', ls);
// hook.js里配置
view_filter: ['think-ls']
// config/ls.js 配置
{
// 是否开启
on: true,
// css配置
css: {
// 以 id:uri路径 的形式, uri以 think.RESOURCE_PATH 为起始路径
id: '/static/dist/a.css'
},
// js配置
js: {
id: '/static/dist/a.js',
global: '/static/dist/b.js'
},
// 可选配置
options: {
// 开始标签
open: '{%',
// 结束标签
close: '%}'
}
}
在模板调用之前加载static/LS.js到模板中,一般加载在<head>结束前
调用css
<%css('id')%>
调用js
<%js('id')%>
主动编译一般在资源被修改后触发,这样可以把资源缓存起来,读取页面模板调用时可以快速判断版本并加载文件
// 该代码需要在thinkjs实例化后调用
var ls = require('think-ls');
new ls().build().then(function(a){
console.log('编译ls结束~');
});
http)文件的支持,目前只支持在think目录里引用think.cache调用的优化,目前所有的配置都在一个cache里,由于多个css,js的source可能很大,后续考虑以css.key来存放MIT
FAQs
think-ls
The npm package think-ls receives a total of 3 weekly downloads. As such, think-ls popularity was classified as not popular.
We found that think-ls 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.