Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use deno_std path module? #30

Open
toyobayashi opened this issue Nov 9, 2022 · 0 comments
Open

Use deno_std path module? #30

toyobayashi opened this issue Nov 9, 2022 · 0 comments

Comments

@toyobayashi
Copy link

toyobayashi commented Nov 9, 2022

Would you mind switch to use deno_std's path module? API is compatible with Node.js, simply use deno bundle to output es module, make bundlers do tree shaking better

// mod.ts
import { win32, posix } from 'https://deno.land/std@0.163.0/path/mod.ts'

export { win32, posix }

export const {
  basename,
  delimiter,
  dirname,
  extname,
  format,
  fromFileUrl,
  isAbsolute,
  join,
  normalize,
  parse,
  relative,
  resolve,
  sep,
  toFileUrl,
  toNamespacedPath
} = posix
deno bundle mod.ts index.js
// package.json
{
  "module": "./index.js",
  "main": "./index.js",
  "type": "module"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant