All Projects → remark-embedder → cache

remark-embedder / cache

Licence: MIT License
A cache for @remark-embedder

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cache

transformer-oembed
@remark-embedder transformer for oEmbed supported links
Stars: ✭ 25 (+108.33%)
Mutual labels:  remark, remark-plugin, remark-embedder
remark-embed-images
plugin to embed local images as data URIs
Stars: ✭ 23 (+91.67%)
Mutual labels:  remark, remark-plugin
strip-markdown
plugin remove Markdown formatting
Stars: ✭ 84 (+600%)
Mutual labels:  remark, remark-plugin
remark-external-links
Legacy plugin to automatically add target and rel attributes to external links — please use `rehype-external-links` instead
Stars: ✭ 50 (+316.67%)
Mutual labels:  remark, remark-plugin
remark-autolink-headings
Legacy remark plugin to automatically add links to headings — please use `rehype-autolink-headings` instead
Stars: ✭ 63 (+425%)
Mutual labels:  remark, remark-plugin
remark-frontmatter
remark plugin to support frontmatter (YAML, TOML, and more)
Stars: ✭ 167 (+1291.67%)
Mutual labels:  remark, remark-plugin
remark-slate-transformer
remark plugin to transform remark syntax tree (mdast) to Slate document tree, and vice versa. Made for WYSIWYG markdown editor.
Stars: ✭ 62 (+416.67%)
Mutual labels:  remark, remark-plugin
remark-admonitions
Add admonitions support to Remarkable
Stars: ✭ 90 (+650%)
Mutual labels:  remark, remark-plugin
remark-license
plugin to generate a license section
Stars: ✭ 15 (+25%)
Mutual labels:  remark, remark-plugin
remark-footnotes
Legacy plugin to add support for pandoc footnotes — please use `remark-gfm` instead
Stars: ✭ 38 (+216.67%)
Mutual labels:  remark, remark-plugin
twoslash
You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
Stars: ✭ 596 (+4866.67%)
Mutual labels:  remark, remark-plugin
remark-bookmarks
plugin to manage links
Stars: ✭ 15 (+25%)
Mutual labels:  remark, remark-plugin
remark-directive
remark plugin to support directives
Stars: ✭ 137 (+1041.67%)
Mutual labels:  remark, remark-plugin
remark-hint
Sprinkle hints/tips/warnings on your documents
Stars: ✭ 36 (+200%)
Mutual labels:  remark, remark-plugin
remark-behead
Remark plugin to increase or decrease markdown heading weight.
Stars: ✭ 14 (+16.67%)
Mutual labels:  remark, remark-plugin
remark-man
plugin to compile markdown to man pages
Stars: ✭ 87 (+625%)
Mutual labels:  remark, remark-plugin
remark-highlight.js
Legacy plugin to highlight code blocks with highlight.js — please use `rehype-highlight` instead
Stars: ✭ 58 (+383.33%)
Mutual labels:  remark, remark-plugin
git-cache-http-server
A caching Git HTTP server
Stars: ✭ 65 (+441.67%)
Mutual labels:  cache
moka
A high performance concurrent caching library for Rust
Stars: ✭ 346 (+2783.33%)
Mutual labels:  cache
justreq
A caching proxy server for testing interface of HTTP or HTTPS. A never offline testing interface server. A mock server
Stars: ✭ 15 (+25%)
Mutual labels:  cache

@remark-embedder/cache

A cache for @remark-embedder/core


Build Status Code Coverage version downloads MIT License All Contributors PRs Welcome Code of Conduct

The problem

You're using @remark-embedder/core and you want to cache the results of your transformers long-term so you don't have to make network requests for HTML every time.

This solution

This is a cache implementation specifically for @remark-embedder/core that saves the results of getHTML for a transformer to disk (in node_modules/.cache by default).

Table of Contents

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:

npm install @remark-embedder/cache

Usage

import Cache from '@remark-embedder/cache'

const cache = new Cache()

async function go() {
  const result = await remark()
    .use(remarkEmbedder, {
      cache,
      transformers: [
        // transformers
      ],
    })
    .use(html)
    .process(someMarkdown)
}

go().then(go).then(go).then(go)

// your transformers will only be called once even though we call process 4 times.

The default directory is pretty reasonable: path.join(process.cwd(), 'node_modules/.cache/@remark-embedder/cache'), but if you want to change it, that's the first argument of the Cache constructor: new Cache(directory).

Inspiration

Other Solutions

I'm not aware of any, if you are please make a pull request and add it here!

Issues

Looking to contribute? Look for the Good First Issue label.

🐛 Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

See Bugs

💡 Feature Requests

Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on.

See Feature Requests

Contributors

Thanks goes to these people (emoji key):


Kent C. Dodds

💻 📖 🚇 ⚠️

Michaël De Boey

📖 💻 🚧

Andreas Houben

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].