
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
extract-mdx-export
Advanced tools
Extract named exports from MDX files using Babel.
code example:
const fs = require('fs')
const extract = require('extract-mdx-export')
const sample = fs.readFileSync('/path/to/file.mdx')
main()
async function main() {
const res = await extract(sample)
console.log(res) // { [...]: { ... } }
}
Optionally, pass a search array option to select keys you want to extract:
const { meta } = await extract(sample, { search: ['meta'] })
Storing stuctured data along with MDX files, and accessing this data at runtime, is a fairly common case. Think of configuration objects you would pass to react-helmet for example.
Now imagine that you want to create a small API / display info out of a bunch of MDX files. You would have to actually import each of these files in order to acces their metadata. No thanks 🙅‍♀️: use this package instead!
See a (WIP) example here: https://github.com/trycereals/next, where a Netlify plugin uses extract-mdx-export to create a JSON index file. It then can be directly accessed by a Netlify function ✌️
FAQs
Extract named exports from MDX files using Babel
We found that extract-mdx-export demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.