
Product
Introducing Socket Scanning for VS Code Marketplace Extensions
Socket now scans VS Code extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@unblockneteasemusic/rust-napi
Advanced tools
UnblockNeteaseMusic/server-rust 的 N-API binding目前使用者文件及開發文件 仍在撰寫,在此之前有任何問題,歡迎開 Discussion 詢問。
您可以直接從 https://www.npmjs.com 引用 @unblockneteasemusic/rust-napi 函式庫。
這個函式庫會協助您取回符合系統架構的套件。
就如〈架構〉所說,rust-napi 函式庫的引擎和類型定義,現階段內建在函式庫,
因此可以省去註冊引擎的步驟。但與舊版 JS 不同,UNM 輸往 console 的 logging 需手動開啟:
const UNM = require("@unblockneteasemusic/rust-napi");
// 啟用後,可以使用 `RUST_LOG` 環境變數調整 log 的詳細程度
UNM.enableLogging(UNM.LoggingType.ConsoleEnv);
然後我們可以建立一個 executor 實體,並定義想要的 context:
const executor = new UNM.Executor();
const ctx = {}; // 假如不需要任何設定
/* const ctx = { enableFlac: true }; // 每個欄位的說明資訊,現階段可參考函式庫中 `index.d.ts` 的定義。 */
接下來的使用方式與 Rust 函式庫相似:
const searchResult = await executor.search(
// 使用所有可以使用的引擎。
//
// executor.list() 會列出所有可用的引擎。我們直接把這個引擎名單傳入 .search()。
// 您亦可自訂要使用的引擎,如 ["bilibili", "kugou"]。
//
// 所有可使用的引擎,現階段可以參考 executor.rs 檔案中
// construct_executor() 函式的定義。
executor.list(),
{
id: "12345",
name: "青花瓷",
artists: [
{
id: "114514",
name: "周杰伦",
},
],
},
ctx
);
const retrieveResult = await executor.retrieve(searchResult, ctx);
與 Rust 版通用的設定,請見 https://github.com/UnblockNeteaseMusic/server-rust/blob/main/README.md
This project is licensed under LGPL-3.0-only.
FAQs
Node.js binding for UNM Rust
The npm package @unblockneteasemusic/rust-napi receives a total of 42 weekly downloads. As such, @unblockneteasemusic/rust-napi popularity was classified as not popular.
We found that @unblockneteasemusic/rust-napi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.

Product
Socket now scans VS Code extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Research
/Security News
Socket uncovered two malicious VS Code themes in a GlassWorm-linked cluster with thousands of installs across VS Code Marketplace and Open VSX.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.