profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/sindresorhus/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Sindre Sorhus sindresorhus https://sindresorhus.com Full-Time Open-Sourcerer. Focuses on Swift & JavaScript. Makes macOS apps, CLI tools, npm packages. Likes unicorns.

addyosmani/critical 9270

Extract & Inline Critical-path CSS in HTML pages

addyosmani/a11y 1686

Accessibility audit tooling for the web (beta)

addyosmani/tmi 1650

TMI (Too Many Images) - discover your image weight on the web

bcoe/awesome-cross-platform-nodejs 960

:two_men_holding_hands: A curated list of awesome developer tools for writing cross-platform Node.js code

avajs/ava-docs 468

Localized docs for AVA

avajs/awesome-ava 327

Awesome AVA resources

fregante/github-issue-link-status 272

Colorize issue and PR links to see their status (open, closed, merged)

download-directory/download-directory.github.io 259

Web App: Download just a sub directory from a GitHub repo.

avajs/eslint-plugin-ava 217

ESLint rules for AVA

fregante/delegate-it 159

DOM event delegation, in <1KB

issue commentsindresorhus/find-up

Usage of node:path is incompatible with declared engines

https://nodejs.org/en/blog/release/v12.20.0/

kachkaev

comment created time in 10 hours

issue closedsindresorhus/find-up

Usage of node:path is incompatible with declared engines

👋 @sindresorhus!

I was fiddling with prettier-vscode and noticed an issue with find-up’s import from node:path. When running yarn test, the extension was crashing by saying that it could not resolve node:path.

According to v6.0.0 CHANGELOG and package.json → engines, find-up is expected to work on any Node version that supports ESM. However, looks like node:path import has a stricter constraint, more specifically Node 14.18 and Node 16+.

closed time in 10 hours

kachkaev

issue commentsindresorhus/find-up

Usage of node:path is incompatible with declared engines

It is supported on Node.js 12 since 12.20:

https://github.com/sindresorhus/find-up/blob/ace3d10aadce889a78924954a2766af81eb315ff/package.json#L15-L17

kachkaev

comment created time in 10 hours

pull request commentsindresorhus/boxen

Rework tests to use snapshots

This is so much nicer. Thanks for doing this 👍

Would you be interested in becoming a maintainer on this project? You have done some great work. No worries if not though.

Caesarovich

comment created time in 11 hours

push eventsindresorhus/boxen

Caesarovich

commit sha 724f59c5def1f0d775f849db3023d83229619ea4

Rework tests to use snapshots (#64)

view details

push time in 11 hours

PR merged sindresorhus/boxen

Rework tests to use snapshots

This PR reworks the all the unit testing for this library into snapshot tests, as suggested by @sindresorhus . So first of all I deleted the old test.js file which was getting pretty long (800~ lines), and spitted it into multiple files in the 'tests' folder. This folder is organized into files corresponding to all the main options for the library. Thus each file contains unit tests relative to the option it is named upon. Tests aiming to determine if X option break Z option when combined together should be conducted in the Z file. So the Z file should test for all combination of options that could break Z, etc... (If don't know if I'm clear there but that's just picky).

So sorry in advance because this is going to be a pain to review since there's a lot of tests, files, and snapshots.

+1186 -783

5 comments

26 changed files

Caesarovich

pr closed time in 11 hours

push eventsindresorhus/is-npm

Yoshida Tomio

commit sha 5c0ad04f3c6c2b13e4e5087a45d6124c1ced105a

Update `yarn run` link (#16)

view details

push time in 12 hours

PR merged sindresorhus/is-npm

Update `yarn run` link
+3 -3

2 comments

2 changed files

1chiSensei

pr closed time in 12 hours

push eventvadimdemedes/ink

inokawa

commit sha 771575eb8587c186a755943ca33d49ead2685a42

Fix `Box` example in the readme (#477)

view details

push time in 12 hours

release sindresorhus/type-fest

v2.3.4

released time in 12 hours

created tagsindresorhus/type-fest

tagv2.3.4

A collection of essential TypeScript types

created time in 12 hours

push eventsindresorhus/type-fest

Sindre Sorhus

commit sha fc4af4a7819c28162126a66c79af5f5d5b8b23ac

2.3.4

view details

push time in 12 hours

issue commentsindresorhus/into-stream

ReadableStream support

It should already be supported since a web stream is an async iterable, but we could indeed explicitly document that.

louisgv

comment created time in 12 hours

issue commentelectron-userland/electron-builder

Don't set GitHub Releases draft title

Please keep this open.

sindresorhus

comment created time in a day

issue commentsindresorhus/map-obj

Throw error on Arrays.

I don't think we should limit it to plain objects. There are valid use-cases for mapping from non-plain objects. I do agree we should not allow arrays though.

rocktimsaikia

comment created time in a day

issue commentwulkano/Kap

MP4's exported incompatible with android and whatsapp web

We upgraded ffmpeg in https://github.com/wulkano/Kap/pull/1021. That might have caused it.

Make sure you use MP4 (H264) and not HEVC. There might be some services/phones that don't support HEVC.

sam-moreton

comment created time in a day

pull request commentsindresorhus/file-type

Refactor function `_fromTokenizer` to a `FileTypeParser` class

We can reasonable effective check the return type in a loop:

From experience, the problem with that is when you need to have some adhoc logic between the steps for example. But I guess we can deal with that if it happens.

Borewit

comment created time in a day

push eventsindresorhus/type-fest

Szymon Marczak

commit sha 93fa71c8ff6a73831f740f7240df077c5e62232b

Fix `Except` autocomplete (#268)

view details

push time in a day

issue closedsindresorhus/type-fest

Except broken after 2.3.1

v2.3.1 image

v2.3.2+ image

The only reason I use Except instead of build in Omit is because the editor autocomplete

closed time in a day

xiaoyu-tamu

PR merged sindresorhus/type-fest

Fix `Except` autocomplete

Fixes #267

<!--

Thanks for submitting a pull request 🙌

If you're submitting a new type, please review the contribution guidelines: https://github.com/sindresorhus/type-fest/blob/master/.github/contributing.md

-->

+1 -1

0 comment

1 changed file

szmarczak

pr closed time in a day

issue commentnodejs/node

Add convenience method to read JSON file

@benjamingr https://github.com/nodejs/node/issues/40089#issuecomment-918363644

sindresorhus

comment created time in a day

issue commentsindresorhus/Plash

Injecting Javascript from Command Line

Nah, I'm gonna add something to the UI about it.

aspdev91

comment created time in a day

issue commentsindresorhus/file-type

Keep CommonJS API function names

I generally prefer default exports, but in this case, I thought named exports where valuable, both for tree-shaking, and also since there really are 4 main APIs, not one.

Borewit

comment created time in a day

issue commentsindresorhus/file-type

Keep CommonJS API function names

https://github.com/sindresorhus/file-type/issues/494#issuecomment-922446671

Borewit

comment created time in a day

pull request commentsindresorhus/file-type

Refactor function `_fromTokenizer` to a `FileTypeParser` class

I see some challenges making it so

One idea would be to abuse errors:

class FileTypeParser {
	check(header, options) {
		return _check(this.buffer, header, options);
	}

	checkString(header, options) {
		return this.check(stringToBytes(header), options);
	}

	async parse(tokenizer) {
		// ...

		try {
			_parse2Byte();
			_parse3Byte();
		} catch (error) {
			return error.value;
		}
	}

	_parse2Byte() {
		if (this.check([0x42, 0x4D])) {
			throw Result({
				ext: 'bmp',
				mime: 'image/bmp',
			});
		}

		if (this.check([0x0B, 0x77])) {
			throw Result({
				ext: 'ac3',
				mime: 'audio/vnd.dolby.dd-raw',
			});
		}
	}
}

That way we don't have to check the value after each call.

Alternatively, we could use a generator or async generator: https://gist.github.com/mafintosh/9cfb78ec8f2e4989ecd76d1b005d866e

Borewit

comment created time in a day

issue commentsindresorhus/file-type

Keep CommonJS API function names

Is it? I guess this the essence of this discussion. If this should be avoided at all costs, I see a reason to change.

Wildcard import can be useful if a package exports ambiguous named exports or a lot of the named exports cause naming conflicts. It's mostly been used a bridge to import CommonJS packages into ESM since CommonJS default export did not translate to default ESM import. Wildcard can also be useful to re-export stuff between modules internally in the package.

The Node.js API is exposed like this.

The Node.js API is not a good example, as it does what it does for legacy reasons. The Node.js API actually supports both default import and named import for most APIs for that reason.

Borewit

comment created time in a day

pull request commentsindresorhus/file-type

Refactor function `_fromTokenizer` to a `FileTypeParser` class

You're right about buffer, but bytesRead is only used once right below its declaration. There's no reason it should be exposed and mutable to the whole class. This is the kind of problems you get with a class. It's too easy to add everything to this and suddenly everything is mutable from anywhere. With functions, you have to explicitly pass in what you want to expose/mutate. I'm not saying we shouldn't use classes, but it's something to consider.

I just fail to see how it simplifies things in the current PR. It lets us not pass buffer explicitly to a couple of functions. That's it. I would probably see more benefit to this change if you took advantage and split up parse() into smaller private methods. For example, a method for each byte signature length, so parse() wouldn't be so huge.

Borewit

comment created time in a day

pull request commentsindresorhus/boxen

Reworking tests to snapshots

Are you sure you have covered everything that the old tests covered?

Caesarovich

comment created time in a day

Pull request review commentsindresorhus/find-up

Introduce `stopAt` option

 test('sync (cousin file, custom cwd)', t => { 	t.is(foundPath, absolute.baz); }); +test('async (cousin file, custom cwd with stopAt)', async t => {+	const foundPath = await findUp(name.baz, {+		cwd: relative.barDir,+		stopAt: absolute.fooDir,+	});++	t.is(foundPath, undefined);+});

Can you also do a test where the foundPath is the stopAt path?

vast

comment created time in 2 days

PullRequestReviewEvent