
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
egg-address
Advanced tools
$ npm i egg-address --save
// {app_root}/config/plugin.js
exports.eggAddress = {
enable: true,
package: 'egg-address',
};
// {app_root}/config/config.default.js
exports.eggAddress = {
};
see config/config.default.js for more detail.
const list = [
['福建省福州市福清市石竹街道义明综合楼3F,15000000000,张小明', '350181']
];
it('get area', () => {
const ctx = app.mockContext();
const areaDate = ctx.service.address.area();
assert(areaDate['district_list'][0].label === '华东');
});
it('parse', async () => {
const ctx = app.mockContext();
console.log(`输入内容:${list[0][0]}`);
const result = await ctx.service.address.parse(list[0][0]);
console.log(`解析结果:${JSON.stringify(result)}`);
assert(result[0].province === '福建省');
assert(result[0].city === '福州市');
assert(result[0].area === '福清市');
assert(result[0].details === '石竹街道义明综合楼3F');
assert(result[0].name === '张小明');
assert(result[0].mobile === '15000000000');
});
it('parse ALL', async () => {
const ctx = app.mockContext();
for (const item of list) {
const address = Array.isArray(item) ? item[0] : item;
const options = Array.isArray(item) ? item[1] : '';
const code = typeof options === 'object' ? options.code : options;
const [result, ...results] = await ctx.service.address.parse(address, true);
let status = code ? result.code === code : result.__parse;
if (typeof options === 'object') {
for (const key in options) {
assert(result[key] === options[key]);
}
}
if (!status) {
console.log('addressParseTest->fail', `${address} [${code}->${result.code}]`, result, results, options);
}
}
});
Please open an issue here.
FAQs
The npm package egg-address receives a total of 2 weekly downloads. As such, egg-address popularity was classified as not popular.
We found that egg-address 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
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.