Skip to content

Instantly share code, notes, and snippets.

View lupomontero's full-sized avatar
🎯
Focusing

Lupo Montero lupomontero

🎯
Focusing
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 18, 2024 09:04
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@merunga
merunga / arrays.js
Last active May 4, 2018 05:23
propuesta contenido arrays
// Extraido de
// https://github.com/wesbos/JavaScript30/blob/master/04%20-%20Array%20Cardio%20Day%201/index-FINISHED.html
/* global describe it */
// Usaremos el `assert` de node
const assert = require('assert');
// ## Unos datos que usaremos para nuestros ejemplos
// ### Inventores
@wesbos
wesbos / index.html
Created October 4, 2017 17:28
ios 11 compatible getUserMedia
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
@anvaka
anvaka / 00.Intro.md
Last active May 18, 2024 08:30
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@mfn
mfn / netsniff.js
Last active October 30, 2018 13:18
netsniff.js from phantomjs, added DOMContentLoaded
if (!Date.prototype.toISOString) {
Date.prototype.toISOString = function () {
function pad(n) { return n < 10 ? '0' + n : n; }
function ms(n) { return n < 10 ? '00'+ n : n < 100 ? '0' + n : n }
return this.getFullYear() + '-' +
pad(this.getMonth() + 1) + '-' +
pad(this.getDate()) + 'T' +
pad(this.getHours()) + ':' +
pad(this.getMinutes()) + ':' +
pad(this.getSeconds()) + '.' +
@chrisjaure
chrisjaure / deploy.js
Created July 29, 2012 17:16
Deploying nodejs apps with haibu and git
#! /path/to/node
var haibu = require('/path/to/haibu');
var client = new haibu.drone.Client();
process.stdin.resume();
process.stdin.on('data', function(data){
var package = JSON.parse(data.toString());