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 🙏

© 2024 – Pkg Stats / Ryan Hefner

remark-corebc

v0.2.2

Published

A Remark plugin to transform Core Blockchain notations into markdown links.

Downloads

479

Readme

Remark CoreBC

This Remark plugin, "remark-corebc," transforms Core Blockchain notations into Markdown links (when positively checked) and negated text (when negatively checked), enhancing documents with blockchain data integrations. It features ICAN validation, customizable links to blockchain explorers, and formatting options for various blockchain identifiers.

About Blockchain

Blockchain is a decentralized, distributed ledger technology that records transactions across a network of computers. It provides transparency, security, and immutability for data storage and transfer. Core Blockchain is a blockchain platform that offers a scalable, secure, and efficient infrastructure for decentralized applications and digital assets.

The main aim is to support ICAN-based blockchains, such as:

Installation

Install the plugin using npm or yarn:

npm install remark-corebc

Or:

yarn add remark-corebc

Usage

To automatically convert Core Blockchain notations into clickable links or text definition and optionally validate ICAN identifiers:

import remark from 'remark';
import remarkCorebc from 'remark-corebc';

(async () => {
  try {
    const file = await remark()
      .use(remarkCorebc, { enableIcanCheck: true })
      .process('Your markdown text here');
    console.log(String(file));
  } catch (err) {
    throw err;
  }
})();

The plugin recognizes notations such as [cb1234...@cb] and [!cb1234...@cb], converting them to links and optionally validating ICAN identifiers, displaying invalid items as text.

Options

Configure the plugin with the following options:

  • enableIcanCheck: Enable ICAN validation (default: true).
  • enableSkippingIcanCheck: Skip ICAN validation with "!" prefix (default: true).
  • linkNetworks: Link to specific blockchain networks (default: true).
  • explorerUrl: Mainnet explorer URL for constructing links (default: https://blockindex.net/).
  • explorerTestnetUrl: Testnet explorer URL for constructing links (default: https://xab.blockindex.net/).
  • urlPathAddress: URL path for address links, appended to explorerUrl or explorerTestnetUrl. Use ${1} as a placeholder for the address (e.g., address/${1}).
  • urlPathBlockNo: URL path for block number links, appended to explorerUrl or explorerTestnetUrl. Use ${1} as a placeholder for the block number (e.g., block/${1}).
  • urlPathBlockHash: URL path for block hash links, appended to explorerUrl or explorerTestnetUrl. Use ${1} as a placeholder for the block hash (e.g., block/${1}).
  • checkAddress: Transform blockchain addresses (default: true).
  • checkBlockNumber: Transform block numbers (default: true).
  • checkBlockHash: Transform block hashes (default: true).
  • debug: Print transformation details to console (default: false).

Features

  • ICAN Validation: Validates ICAN identifiers for reliability.
  • Link Customization: Customizes links to mainnet and testnet explorers for direct blockchain data access.
  • Data Transformation: Formats blockchain addresses, numbers, and hashes into clickable links.
  • Configuration Flexibility: Tailors behavior with a variety of options.
  • Seamless Integration: Fits into Remark pipelines, enhancing documents with blockchain integrations.

Contributing

Contributions are welcome! Please submit pull requests or open issues to improve the plugin.

License

Licensed under the CORE License.