
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
JavaScriptでMigemoを利用するためのライブラリ
$ npm install jsmigemo
https://cdn.jsdelivr.net/npm/jsmigemo/dist/<filename> の <filename> の部分に、用途に応じて以下のファイル名を指定してください。
| Format | Default | Minified |
|---|---|---|
| ESModule | jsmigemo.mjs | jsmigemo.min.mjs |
| CommonJS | jsmigemo.cjs | jsmigemo.min.cjs |
| IIFE | jsmigemo.iife.js | jsmigemo.min.iife.js |
DefaultとMinifiedの違いは以下です。
ESModuleとCommonJS、IIFEの違いは以下です。
$ npm install jsmigemo
$ jsmigemo
QUERY: kensaku
PATTERN: (kensaku|けんさく|ケンサク|建策|憲[作冊]|検索|献策|研削|羂索|kensaku|ケンサク)
import { readFile } from "node:fs/promises";
import { CompactDictionary, Migemo } from "jsmigemo";
const data = await readFile("migemo-compact-dict");
const buffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
const dict = new CompactDictionary(buffer);
const migemo = new Migemo();
migemo.setDict(dict);
console.log(migemo.query("kensaku"));
//=> (kensaku|けんさく|ケンサク|建策|憲[作冊]|検索|献策|研削|羂索|kensaku|ケンサク)
import { CompactDictionary, Migemo } from "https://cdn.jsdelivr.net/npm/jsmigemo/dist/jsmigemo.min.mjs";
const data = await Deno.readFile("./migemo-compact-dict");
const dict = new CompactDictionary(data.buffer);
const migemo = new Migemo();
migemo.setDict(dict);
console.log(migemo.query("kensaku"));
//=> (kensaku|けんさく|ケンサク|建策|憲[作冊]|検索|献策|研削|羂索|kensaku|ケンサク)
<input id="queryInput" type="text" placeholder="kensaku">
<pre id="regexOutput"></pre>
<script src="https://cdn.jsdelivr.net/npm/jsmigemo/dist/jsmigemo.min.iife.js"></script>
<script>
const DICT_URL = "https://cdn.jsdelivr.net/npm/jsmigemo/migemo-compact-dict";
const queryInput = document.getElementById("queryInput");
const regexOutput = document.getElementById("regexOutput");
let migemo = null;
async function setup() {
const response = await fetch(DICT_URL);
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const buffer = await response.arrayBuffer();
const dict = new window.jsmigemo.CompactDictionary(buffer);
migemo = new window.jsmigemo.Migemo();
migemo.setDict(dict);
}
queryInput.addEventListener("input", () => {
if (!migemo) {
return;
}
regexOutput.textContent = migemo.query(queryInput.value.trim());
});
setup().catch((error) => {
regexOutput.textContent = `辞書の読み込みに失敗: ${error.message}`;
});
</script>
> node bin/jsmigemo-dict.mjs <text-dict-file> <compact-dict-file>
<text-dict-file> は、C/Miemoで使われているテキスト形式の辞書ファイルです。
<compact-dict-file> は、出力ファイル名です。
本ライブラリに付属の辞書ファイルは、MITライセンスのプロジェクトから生成されています。 yet-another-migemo-dict
本プロジェクト配下のファイルは、MIT LICENSEのもとで配布します。
FAQs
migemo on javascript
We found that jsmigemo demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.