Skip to content

Use deno_std path module? #30

@toyobayashi

Description

@toyobayashi

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"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions