Socket
Socket
Sign inDemoInstall

remark-asset-copy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-asset-copy

Copy assets from markdown to folder


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

remark-asset-copy

Copy assets from markdown to a folder inside public.

I created this because there was no easy way to have this type of file structure with next.js without using require().

/
|- content
|   |-post-slug
|   |   |- index.md
|   |   |- image.jpg

How to use

Basic example :

import remark from 'remark';
import vfile from 'vfile';
import frontmatter from 'remark-frontmatter';
import assetCopy from 'remark-asset-copy';

const processedContent = await remark()
  .use(frontmatter)
  .use(html)
  .use(copy, {
    destination: "public/assets",
  })
  .process(vfile.readSync(fullPath));
const contentHtml = processedContent.toString();

Tests

Basic testing is implemented but a deeper tests must be written

FAQs

Package last updated on 19 May 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc