Giter Site home page Giter Site logo

deno-dirname's Introduction

Programming since I was 6, professionally since I was 16.

I got obsessed with programming when I was a kid and hasn't recovered since then.

Currently building custom backend APIs using TypeScript/Node.js for the insurtech industry at Beesafe, Vienna Insurance Group.

๐Ÿ’–Stack ExchangeCodewarsโค๏ธโ€๐Ÿ”ฅ

๐Ÿค GitHub Followers Twitter Followers LinkedIn Connections

โœ๏ธ Medium Quora DEV Wikipedia

๐Ÿ—ฃ YouTube Spotify Crossweb Pocztarski.com

๐Ÿข Backend API JavaScript TypeScript Node.js JSON OpenAPI

๐Ÿ’– Deno Rust NASM Zig WebAssembly WASI

deno-dirname's People

Contributors

rsp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

deno-dirname's Issues

Slash too much

import { __ } from 'https://deno.land/x/dirname/mod.ts';


const { __filename, __dirname } = __(import.meta);

console.log(`${__dirname}/w.ts`.substr(1));

I get /C:/worka/example-deno/w.ts
instead of C:/worka/example-deno/w.ts

temporary solution is to use

console.log(`${__dirname}/w.ts`.substr(1));

Upload to deno.land/x/dirname

The page one lands on when accessing deno.land/x/dirname is currently a message saying the name has been reserved, but no releases have been uploaded yet. Is it the same module? In any case, thanks for the package mate!

suggestion about the name of the main function

could you contemplate the possibility of changing the function name to get a better understanding what do function do, when importing it into the code. Term "__" don't say much.
could to be similar to this:

export function fileData({ url = import.meta.url }: { url: string }) {
const u: URL = new URL(url);
const f: string = u.protocol === 'file:' ? u.pathname : url;
const d: string = f.replace(/[/][^/]*$/, '');
return {
  d,
    f,
    dirname: d,
        filename: f,
     __dirname: d,
     __filename: f,
  };
}

export function dirname(meta: { url: string }) {
  return fileData(meta).__dirname;

export function filename(meta: { url: string }) {
  return fileData(meta).__filename;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.