Have ideas to improve npm?Join in the discussion! »

    md2hatena

    0.3.1 • Public • Published

    md2hatena

    Build Status NPM Version License Coverage Status

    Markdown to Hatena Syntax (はてな記法) converter.

    example

    md2hatena suports all markdown syntax defined in mdast!

    Install

    npm i -g md2hatena

    Usage

    md2hatena can be used in 4 ways:

    As a CLI command

    $ md2hatena foo.md > foo.hatena

    As a Atom command in language-hatena package

    Language Hatena: Convert Markdown To Hatena Syntax command is available in language-hatena package.

    As a library

    import fs from 'fs';
    import { md2hatena } from 'md2hatena';
     
    const md = fs.readFileSync('foo.md', 'utf8');
    md2hatena(md).then((hatena) => {
      console.log(hatena);
    })

    As a remark plugin

    import remark from 'remark';
    import { stringify } from 'md2hatena';
     
    remark().use(stringify).process(md, (vfile) => {
      console.log(vfile.contents);
    });

    LICENSE

    MIT

    Install

    npm i md2hatena

    DownloadsWeekly Downloads

    2

    Version

    0.3.1

    License

    MIT

    Last publish

    Collaborators

    • avatar