![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
filedirname
Advanced tools
Changelog
v3.4.0 2023 December 30
Readme
Fetch the current file and directory path, no matter your environment (Deno, Node.js, Web Browsers, ESM, CJS)
The following works for ESM (ECMAScript Modules) and CJS (CommonJS Modules) enviroments:
// for deno
import filedirname from 'https://unpkg.com/filedirname/edition-deno/index.ts'
// for web browsers
import filedirname from 'https://unpkg.com/filedirname'
// for node.js
import filedirname from 'filedirname'
// for commonjs
const filedirname = require('filedirname').default
// usage
const [file, dir] = filedirname()
console.log({ file, dir })
The following works for ESM (ECMAScript Modules) and CJS (CommonJS Modules) environments:
// for deno
import filedirname from 'https://unpkg.com/filedirname/edition-deno/index.ts'
// for web browsers
import filedirname from 'https://unpkg.com/filedirname'
// for node.js
import filedirname from 'filedirname'
// for commonjs
const filedirname = require('filedirname').default
// usage
const [file, dir] = filedirname(new Error())
console.log({ file, dir })
import.meta.url
The following works only for ESM (ECMAScript Modules) environments and is the quickest solution:
// for deno
import filedirname from 'https://unpkg.com/filedirname/edition-deno/index.ts'
// for web browsers
import filedirname from 'https://unpkg.com/filedirname'
// for node.js
import filedirname from 'filedirname'
// usage
const [file, dir] = filedirname(import.meta.url)
console.log({ file, dir })
npm install --save filedirname
import pkg from ('filedirname')
const pkg = require('filedirname').default
import pkg from 'https://unpkg.com/filedirname@^3.4.0/edition-deno/index.ts'
This package is published with the following editions:
filedirname
aliases filedirname/index.cjs
which uses the Editions Autoloader to automatically select the correct edition for the consumer's environmentfiledirname/source/index.ts
is TypeScript source code with Import for modulesfiledirname/edition-es2022/index.js
is TypeScript compiled against ES2022 for Node.js 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesfiledirname/edition-es5/index.js
is TypeScript compiled against ES5 for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesfiledirname/edition-es2022-esm/index.js
is TypeScript compiled against ES2022 for Node.js 12 || 14 || 16 || 18 || 20 || 21 with Import for modulesfiledirname/edition-types/index.d.ts
is TypeScript compiled Types with Import for modulesfiledirname/edition-deno/index.ts
is TypeScript source code made to be compatible with DenoDiscover the release history by heading on over to the HISTORY.md
file.
Discover how to contribute via the CONTRIBUTING.md
file.
Unless stated otherwise all works are:
and licensed under:
FAQs
Fetch the current file and directory path, no matter your environment (Deno, Node.js, Web Browsers, ESM, CJS)
The npm package filedirname receives a total of 13,418 weekly downloads. As such, filedirname popularity was classified as popular.
We found that filedirname demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.