New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@adaptably/to

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adaptably/to

Get the absolute path to a file in an ES6 module.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

@adaptably/to

Get the absolute path to a file in an ES6 module.

Installation

npm install @adaptably/to

Usage

import to from '@adaptably/to'

const path = to(target, source)

Arguments

NameTypeDescription
targetStringThe relative path to the target file.
sourceObjectAn object with one key (from) which contains the absolute path to the source file (usually import.meta.url).

Example

Given the file structure:

source/
  folder1/
    1.js
  folder2/
    2.js

1.js

import pathTo from '@adaptably/to'

const path = pathTo('../folder2/2.js', { from: import.meta.url })
// => /absolute/path/to/folder2/2.js

FAQs

Package last updated on 02 Jan 2023

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