Socket
Socket
Sign inDemoInstall

@baidu-map/bns

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @baidu-map/bns

Node.js n-api bns cpp addon


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
2.56 MB
Created
Weekly downloads
 

Readme

Source

nodejs napi bns addon

迁移自node-bns,具体干啥的

安装

npm install @baidu/bns 

备注:

  1. 注意目前仅支持公司开发机linux环境运行
  2. 需要使用厂内重新编译后的Nodejs版本,官网直接下载不能使用此扩展

开发build

sh deps.sh ##待完善,依赖安装 bcloud
npm run build

测试

npm run test

这次迁移开发有一下特点

  • node v12版本支持,使用 napi,理论对后续 node 版本也可兼容
  • 使用prebuildify,安装时候自动检查跳过编译也不会从网络下载,开发生产环境直接使用编译好的扩展
  • get_instance_by_service_asyncget_service_conf_async 方法返回 promise,对于 node12版本可以直接 await执行,不再使用回调方法

注意项

  • get_instance_by_service_async 会 reject, get_service_conf_async也有 reject
  • get_instance_list 这个方法注意下,貌似一直不可用,如有有线上用到请联系

todo

  • benchmark

欢迎大家一起参与 nodejs addon 生态开发

Keywords

FAQs

Last updated on 12 Mar 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc