
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
根据区划代码找关联区划。
npm i sp-area //or yarn add sp-area
npm run build
<script src="https://unpkg.com/sp-area/dist/index.min.js"></script>
<script>
let {area} = __AREA;
let origion = [
{ '510000': '四川省'},
{ '510100': '成都市' },
{ '510200': '绵阳市' },
{ '510201': '涪城区' },
{ '510202': '三台县' },
{ '510101': '武侯区' },
{ '510112': '青羊区' },
{ '520000': '贵州省' },
{ '520100': '贵阳市' },
{ '520101': '花溪区' },
{ '520102': '小河区' },
{ '520200': '安顺市' },
{ '520201': '安顺区'}]
area({
origion: origion,
target: '510112',
type: 'siblings',
hasOwn: true,
formatter(result) {
result.forEach(item => {
item.name = item.name.replace(/区|县/,'')
})
return result
}
})
// [ { code: '510101', name: '武侯' },{ code: '510112', name: '青羊' } ]
</script>
const {
area
} = require("sp-area")
area(obj = {})
let origion = [
{ '510000': '四川省'},
{ '510100': '成都市' },
{ '510200': '绵阳市' },
{ '510201': '涪城区' },
{ '510202': '三台县' },
{ '510101': '武侯区' },
{ '510112': '青羊区' },
{ '520000': '贵州省' },
{ '520100': '贵阳市' },
{ '520101': '花溪区' },
{ '520102': '小河区' },
{ '520200': '安顺市' },
{ '520201': '安顺区'}];
area(
{
origion: origion,
target: '510100',
type: 'children',
hasOwn: false,
formatter(result) {
result.forEach(item => {
item.name = item.name.replace(/区|县/,'')
})
return result
}
}
);
// '[ { code: '510101', name: '武侯' },{ code: '510112', name: '青羊' } ]'
area(
{
origion: origion,
target: '510100',
type: 'children',
hasOwn: true,
formatter(result) {
result.forEach(item => {
item.name = item.name.replace(/区|县/,'')
})
return result
}
}
);
// '[ { code: '510100', name: '成都市' },{ code: '510101', name: '武侯' },{ code: '510112', name: '青羊' } ]'
area(
{
origion: origion,
target: '510100',
type: 'siblings',
hasOwn: false,
formatter(result) {
result.forEach(item => {
item.name = item.name.replace(/区|县/,'')
})
return result
}
}
);
// '[ { code: '510200', name: '绵阳市' } ]'
area(
{
origion: origion,
target: '510100',
type: 'siblings',
hasOwn: true,
formatter(result) {
result.forEach(item => {
item.name = item.name.replace(/区|县/,'')
})
return result
}
}
);
// [ { code: '510100', name: '成都市' },{ code: '510200', name: '绵阳市' } ]
area(
{
origion: origion,
target: '510100',
type: 'parent',
formatter(result) {
result.forEach(item => {
item.name = item.name.replace(/区|县/,'')
})
return result
}
}
);
// [ { code: '510000', name: '四川省' } ]
FAQs
We found that sp-area 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.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.