$pm add vite
# should be success
$pm run vite --version
# shoud be fail
$pm run esbuild --version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert Wikipedia page articles dump (XML) into a stream of JSON | |
// { id: 0, "title": "...", "text": "..." } | |
// The "text" field format will also be converted into plain text | |
import * as path from 'node:path'; | |
import * as fs from 'node:fs'; | |
import XMLParser from 'node-xml-stream'; | |
import ndjson from 'ndjson'; | |
import instaview from 'instaview'; | |
import htmlEntities from 'html-entities'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>SharedArrayBuffer GC test</title> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script type="module"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- The script is injected to the `<head>`, so prevent possible network access from the content script. --> | |
<script type="text/javascript"> | |
if ( | |
!Boolean(navigator.userAgent.match(/android/i)) & | |
Boolean(navigator.userAgent.match(/Chrome/) || | |
navigator.userAgent.match(/Firefox/) || | |
navigator.userAgent.match(/Safari/) || | |
navigator.userAgent.match(/MSIE|Trident|Edge/))) { | |
window.FbPlayableAd = { | |
onCTAClick() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
Celcius: <input id="ce" type="number"> | |
Fahrenheit: <input id="fa" type="number"> | |
</div> | |
<script type="importmap"> | |
{ | |
"imports": { | |
"rescript/": "/node_modules/rescript/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Comparable<T> { | |
compare(a: T, b: T): number; | |
} | |
export class Heap<T> { | |
#values: T[] = []; | |
#id: Comparable<T>; | |
constructor(id: Comparable<T>) { | |
this.#id = id; |
As a maintainer of graphql-plugin-typegen, I have been thinking about an ergonomic way to provide GraphQL types in the Gatsby project for a long time.
In the first version of the plugin, users always had to directly import the type definitions from the generated files.
import * as React from 'react';
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as path from 'node:path'; | |
import * as fs from 'node:fs/promises'; | |
const nodeModules = path.resolve('node_modules'); | |
let moduleNames = await fs.readdir(nodeModules); | |
moduleNames = (await Promise.all( | |
moduleNames.map(async name => { | |
if (name.startsWith('.')) { | |
return []; |