Socket
Socket
Sign inDemoInstall

desm

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

desm

get the file directory from import.meta.url


Version published
Maintainers
1
Created
Source

desm

The missing one-liner utility to get the dirname from import.meta.url.

Requires Node 12.17.0 or Node 14.0.0.

Install

npm i desm

Usage

import desm from 'desm'

console.log(desm(import.meta.url))

or

import { dirname, join } from 'desm'

console.log(dirname(import.meta.url))
console.log(join(import.meta.url, 'routes'))
console.log(join(import.meta.url, '..', 'other'))

License

MIT

Keywords

FAQs

Package last updated on 29 Nov 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