The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
. /etc/os-release
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update -qq
sudo apt-get -qq -y install buildah
``
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 { ApolloServerPlugin, GraphQLServiceContext } from "apollo-server-plugin-base"; | |
import { GraphQLSchema, separateOperations } from "graphql"; | |
import { fieldConfigEstimator, getComplexity, simpleEstimator } from "graphql-query-complexity"; | |
export class ApolloComplexityPlugin implements ApolloServerPlugin { | |
private schema: GraphQLSchema; | |
constructor(private maxComplexity: number) { } | |
public serverWillStart(service: GraphQLServiceContext) { |
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
.terraform/ | |
*.pem | |
*.tf | |
*.tfstate | |
*.yaml | |
*.backup | |
istio-*/ | |
cert-manager-*/ | |
*.swp | |
env |
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 classNameProp from 'class-name-prop'; | |
import { useRouter } from 'next/router'; | |
import React from 'react'; | |
import styles from './RouteIndicator.module.css'; | |
const DONE_DURATION = 250; | |
export default function RouteIndicator() { | |
const router = useRouter(); |
React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.
Table of Contents
React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.
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
const stream = require('stream') | |
const cache = new Map() // you might wanna use an lru here | |
function createCacheStream (url) { | |
const buf = [] | |
return stream.Transform({ | |
transform: function (data, enc, cb) { | |
buffer.push(data) | |
cb(null, data) | |
}, |
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
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"os/signal" | |
"syscall" | |
"time" |
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
/* eslint-disable prefer-template */ | |
const path = require('path'); | |
const aliases = require('./aliases'); | |
// /////////////////////////////////////////////////////////////// | |
// ////////////////// PLUGINS //////////////////////////////// | |
// /////////////////////////////////////////////////////////////// | |
const commonPlugins = [ |
NewerOlder