bp, to random

import.meta.resolve takes a #JavaScript module specifier (a relative or absolute path, or a bare module specifier with an optional subpath) and returns a path on disk.

For #node.js, Is there a function to perform the inverse operation? Given an abspath to a file on disk, I want to "deresolve" it to a relative path as referenced in the exports map

"exports": {   
 ".": "./bundle.js",  
 "./" "./dist/"  
}  

Given ./dist/a.js, how to I get to ./a.js?

pasimako, to programming

When trying to console.log large objects in node, the output sometimes gets truncated. My quick solution is to JSON.stringify the object, but then I lose the colors that util.inspect provides, which are nice to have.

To keep the colors you can write to stdout directly like so:

process.stdout.write(util.inspect([...], { colors: true, maxArrayLength: null }) + "\n");

#nodejs #node #javascript #webdev

skwee357, to typescript

Starting a new project in other languages

  1. <buildtool> init
  2. Start coding

Starting a new project in

  1. npm or yarn?
  2. (n/y) init
  3. Add typescript
  4. Configure tsconfig
  5. Add more packages
  6. Start coding

skwee357,

@raiderrobert Dependency management in #node is insane

skwee357, to rust

Should I use #rust or #node for my next project? It’s mainly API based, except for thin frontend for authentication and minor management.

#buildinpublic

ehmicky, to programming

get-stream just had a major release v8.0.0, with lots of improvements. It is a helpful utility to return a stream's contents. It works in Node, Deno and browsers. It can set a maximum size, or return partially read data on errors.

https://github.com/sindresorhus/get-stream

#nodejs #javascript #deno #typescript #stream #js #node

louislang, to node

Nine #npm packages uncovered by phylum.io communicating with command and control infrastructure in what appear to be continuing targeted attacks.

#javascript #malware #infosec #node #opensource

https://blog.phylum.io/sophisticated-highly-targeted-attacks-continue-to-plague-npm/

vanilla, to webdev
@vanilla@social.spicyweb.dev avatar

All right nerds, we got some 🌶️ spicy content on the blog for you today! 🤓

A writeup and code/demos all about server-rendering via in three popular flavors: , , and !

Also a ton of thoughts about the future of these technologies and how to promote a portable view layer of web applications in an -first world.

Take a peek and then hop in our Discord to chat more about all these groovy features!

https://www.spicyweb.dev/web-components-ssr-node/

joelanman, to programming
@joelanman@hachyderm.io avatar
denhasanenko, to programming Russian

How many of you ever made a reverse design of a software project? Which methods did you use for it?

deno_land, to node
@deno_land@fosstodon.org avatar

A Next.js app requires dozens of config files — next.config.js, eslintrc.json, tsconfig.json, package.json, postcss.config.js, tailwind.config.js, and more.

How did we get here? How do we avoid it?

https://deno.com/blog/node-config-hell/

sixtus, to random German
@sixtus@mastodon.social avatar

Ich halte im Übrigen die Erzählung "Die #AfD profitiert von dem Streit in der Ampel", die von vielen, auch seriösen Medien und Kommentatorinnen verbreitet wird, für Humbug. Denn das würde bedeuten, 20 (+x) Prozent der Wählerinnen wollen lieber Faschismus als eine häufig uneinig handelnde Regierung. Konkreter: Jeder*r fünfte Deutsche will eher eine Diktatur als Diskussionen auf der Regierungsbank. Gibt es für diese implizit transportierte These denn irgendwelche Belege?

Sagittarius_Galaxie,
@Sagittarius_Galaxie@mastodon.social avatar
jdapena, to node Spanish

New blog post, this time in v8.dev! https://v8.dev/blog/speeding-up-v8-heap-snapshots

There, I break down several optimizations in heap snapshot that I landed in V8. The improvements generating the heap snapshots are over 50%. But, for minified code, it can be over 90%! 🚀.

This work is part of the collaboration between @igalia and Bloomberg ❤️

This post is also a continuation of the previous one about memory profiling for and .js https://blogs.igalia.com/dape/2023/05/18/javascript-memory-profiling-with-heap-snapshot/

hazz223, to node
@hazz223@mstdn.social avatar

Is there a reason why folks use Yarn instead of NPM?

They seem kinda the same now days?

#node #js #code #javascript #programming

Crell, to php
@Crell@phpc.social avatar
letmesleep, (edited ) to dach in Union will Individualrecht auf Asyl abschaffen

Gibt es eigentlich irgendwelche Fakten die belegen dass es diese Wirtschaftsmigration als Teil von Flüchtlingsströmen überhaupt gibt oder ist das alles nur den wilden Fantasien der Rechtsradikalen entsprungen?

Es gibt die Annerkennungsquoten für Asylanträge.

Zusammengefasst: Die meisten irregulären Migranten sind keine Flüchtlinge und vermutlich könnte man die Zahl der anerkannten Flüchtlinge durch strengere Prüfung noch weiter senken, aber man muss hier die Definition von “Flüchtling” beachten. Flüchtling ist nach der Genfer Flüchtlingskonvention nur, wer aufgrund von Herkunft, Religion etc. verfolgt wird. Nicht-diskriminierende Verfolgung, Kriege, Hungersnöte und Naturkatastrophen sind nicht erfasst. Es gibt also Menschen, die vor dem sicheren Tod fliehen ohne Flüchtlinge zu sein. Diese Menschen haben aber immer noch ein Recht auf subsidären Schutz. Wenn man den BAMF-Daten glaubt, machen Menschen mit “gutem” Fluchtgrund also schon die Mehrheit der Menschen, die einen Antrag stellen, aus. Menschen ohne solch einen Grund stellen ca. 1/4 der Antragssteller (bitte beachten: das sind keine Ukrainer in den Daten).

cjerrington, (edited ) to github
@cjerrington@mstdn.social avatar

What is your dependency tool for your projects?

#git #github #codeberg #node #dependabot #renovate

itnewsbot, to javascript

Deno unveils faster, simpler web server API - Deno 1.35, the latest version of the JavaScript/TypeScript/WebAssembly runtime positio... - https://www.infoworld.com/article/3702712/deno-unveils-faster-simpler-web-server-api.html#tk.rss_all #developmentlibrariesandframeworks #softwaredevelopment #webdevelopment #javascript #node.js

yoavlavi, to rust

Just published a post on how you can compile to for use with , and . There's also an included repository and CodeSandbox demo. Take a look!

https://grafbase.com/blog/getting-started-with-rust-and-webassembly

remixtures, to javascript Portuguese
@remixtures@tldr.nettime.org avatar

#JavaScript #Node #NPM #SoftwareDevelopment #Programming: "Oh, dear jest. It started as a fast test runner. But now it’s big and fat, it depends on some babel packages while the rest of your app is transpiled by a mix of esbuild and swc. Properly configuring it with ESM and TypeScript was a PhD science project.

You stop to count how many tools and parsers work on your codebase: TypeScript, esbuild, swc, babel, eslint, prettier, jest, webpack, rollup, terser. You are not sure if you missed any. You are not sure if you want to know. The level of pain is so high you forget about anything else."

https://frantic.im/javascript-gom-jabbar/

schizanon, to microsoft

When I try to contact #NPMjs to recover access to my account, I get support messages from "npm@githubsupport.com". This makes a lot of sense because the quality of support is exactly as bad as I would expect from a #Microsoft owned organization.

#NPM == M$

The #JavaScript ecosystem has been bought!

#webDev #webDevelopment #nodeJS #node #js #frontEnd #backend #fullstack

jasongaylord, to webdev
emilis, to javascript

I'm looking for a new job.

I've ben working as a web developer for 20+ years. Last 13 years with , 11 with .js, 8 with .

I live in , . I expect to work hybrid or remote. Can start from September 1st.

I prefer , , innovative projects, teams that use functional programming (would switch from JS if needed).

My CV: https://emilis.codeberg.page/cv2023.html
LinkedIn: https://www.linkedin.com/in/emilisdambauskas/

schizanon, to webdev

Today's my first day trying #deno.

Not sure how I feel about the built in #linter and formatter yet; me and #prettier are besties, and I have gotten used to #eslint

Still gonna give it a try.

#webDev #nodejs #node #npm #npmjs #javaScript #programming #code #dependencies

schizanon, to node
schizanon, to javascript

#Deno supports comments in it's config file!? How has this not caught on yet!?

https://deno.land/manual@v1.34.3/getting_started/configuration_file

#javaScript #npm #npmjs #nodejs #node #webDev

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • modclub
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • megavids
  • provamag3
  • normalnudes
  • Leos
  • lostlight
  • All magazines