New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@bgm38/wiki

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bgm38/wiki

bangumi wiki syntax parser

latest
Source
npmnpm
Version
0.3.3
Version published
Weekly downloads
437
174.84%
Maintainers
0
Weekly downloads
 
Created
Source

解析 bangumi 的 wiki 语法

https://github.com/bangumi/wiki-syntax-spec

安装

npm i @bgm38/wiki

使用

没有 cjs 导出,请使用 esm 导入。

import type { Wiki } from '@bgm38/wiki';
import { parse2, WikiSyntaxError } from '@bgm38/wiki';

const [error, w] = parse2('...');
if (error) {
  console.log('bad wiki string', `${error.message}`);
} else {
  console.log('wiki', w);
}

在用户脚本中使用(在 bangumi 组件中不起效):

// ==UserScript==
// @name        new user script
// @version     0.0.1
// @match       https://example.com/*
// @require     https://cdn.jsdelivr.net/npm/@bgm38/wiki@0.3.2
// ==/UserScript==

(() => {
  console.log(bangumiWikiParser.parse2('...'));
})();

开发

下载代码

git clone --recursive https://github.com/bangumi/wiki-parser bangumi/wiki-parser
cd bangumi/wiki-parser

安装依赖

pnpm i

测试

pnpm test

FAQs

Package last updated on 28 Oct 2024

Did you know?

Socket

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