npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

redpen-validator-easy-to-read-japanese-document

v0.0.5

Published

redpen custom validator for writing a easy-to-read japanese document

Downloads

44

Readme

redpen-validator

Javascript拡張を利用したRedPenのValidatorです。

Code Climate

使い方

RedPenのコンフィグファイルに以下を追記します。

<validator name="JavaScript" >
    <property name="script-path" value="/Path/to/this/repo/on/your/env" />
</validator>

各ファイルが対応する検査項目

|ファイル名 |検査項目 |参考文献 | |----------------------------|--------------------------|-----------------------| |use-joyo-Kanji.js |常用漢字を使っているか |JTF 日本語標準スタイルガイド(翻訳用) 2.1.2| |katakana-must-be-two-byte.js|全角のカタカナを使っているか |JTF 日本語標準スタイルガイド(翻訳用) 2.1.5| |numeral-must-be-hankaku.js |半角の算用数字を使っているか |JTF 日本語標準スタイルガイド(翻訳用) 2.1.8| |alphabet-must-be-one-byte.js|半角のアルファベットを使っているか |JTF 日本語標準スタイルガイド(翻訳用) 2.1.9| |use-hiragana-and-kanji-properly.js |ひらがなと漢字の使い分け|JTF 日本語標準スタイルガイド(翻訳用) 2.2.1| |use-numeral-properly.js |算用数字と漢数字の使い分け   |JTF 日本語標準スタイルガイド(翻訳用) 2.2.2| |ka-is-written-in-hiragana.js|助数詞にともなう「か」の表記 |JTF 日本語標準スタイルガイド(翻訳用) 2.2.3| |symbol.js |記号の使い方が適切か |JTF 日本語標準スタイルガイド(翻訳用) 4.2 & 4.3| |use-assertive-style.js |断定を避ける表現 |use-assertive-style.js内に記載| |use-literary-style.js    |口語表現 |use-literary-style.js内に記載 | |dont-use-kosoado.js |こそあど言葉 |dont-use-kosoado.js内に記載 | |dont-use-can-do.js |することができる |dont-use-can-do.js内に記載 | |custom-pattern.js |自分で登録した規則が含まれているか  |なし

custom-pattern.js

自分で表記の規則を登録して利用する拡張です。terms配列に登録されている表記の規則を利用して、文章に規則から外れた表現が含まれているかを検査します。検査方法は正規表現と形態素解析の二つをサポートしています。

正規表現による検査

正規表現による検査を行う場合、terms配列に以下パラメータを持ったオブジェクトを登録します。

{
    'pattern':'ではないだろうか',
    'message':'断定を避ける表現です。断定系を使ってください。',
}

形態素解析による検査

形態素解析による検査を行う場合、terms配列に以下プロパティを持ったオブジェクトを登録します。

{
    'pattern':'考えられる',
    'message':'断定を避ける表現です。断定系を使ってください。',
    'tokens':[
        {
            'tags0':'動詞',
            'tags1':'自立',
            'tags6':'考える'
        },
        {
            'tags0':'動詞',
            'tags1':'接尾',
            'tags6':'られる'
        }
    ]
},

tokensプロパティには、kuromojiによる形態素解析の結果を登録します。各項目とkuromojiによる形態素解析の結果は、以下の通り紐づいています。kuromojiによる形態素解析の結果はkuromojiのデモサイトで取得するのが簡単です。

|項目 |登録内容| |------|-------| |tags0 |Part-of-Speechの1つ目(kuromojiが生成するTokenに含まれるFeatureの1つ目)| |tags1 |Part-of-Speechの2つ目(kuromojiが生成するTokenに含まれるFeatureの2つ目)| |tags6 |Base form(kuromojiが生成するTokenに含まれるFeatureの7つ目)|

謝辞

use-joyo-Kanji.jsの作成にあたっては、以下のサイトを参考にさせていただきました。感謝します。