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.
function preprocessImage(canvas) { | |
const ctx = canvas.getContext('2d'); | |
const image = ctx.getImageData(0,0,canvas.width, canvas.height); | |
blurARGB(image.data, canvas, 1); | |
dilate(image.data, canvas); | |
invertColors(image.data); | |
thresholdFilter(image.data, 0.4); | |
return image; | |
} |
async function cryptoSign(message) { | |
const key = await window.crypto.subtle.generateKey( | |
{ | |
name: "HMAC", | |
hash: { name: "SHA-512" }, | |
}, | |
true, | |
["sign", "verify"] | |
); | |
const encodedText = new TextEncoder().encode(message); |
<html> | |
<head> | |
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<!-- Require the peer dependencies of facemesh. --> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf-core.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf-converter.min.js"></script> |
The following regular expressions are crafted to match some commonly used cryptocurrency wallet address types. This document details the Regex components and pattern tests to match Ethereum, Bitcoin, Dash and Monero addresses.
/^0x[a-fA-F0-9]{40}$/g
// app/modules/authentication/authentication.controller.ts | |
import { Body, Controller, Post } from '@nestjs/common' | |
import { RegisterRequest } from './requests' | |
import { User } from '../../modules/user' | |
import { UsersService } from '../users/users.service' |
FROM node:12 | |
WORKDIR /app | |
COPY ./package*.json ./ | |
RUN npm install | |
ENV PORT=4000 | |
COPY . . | |
CMD ["npm","run","start"] |
Once upon a time, there was a developer that had an issue using the TypeScript language. He wanted to share his issue with the community to get help, but he didn't know how to properly write the title that would best describe his problem. He struggled to find the appropriate words as he didn't know how to name "this behavior" or "that kind of type mechanism".
This story encouraged me to start writing a glossary of TypeScript. Hopefully it will help you if you have to look for an issue, write an issue, or communicate with other TypeScript developers.
Disclaimer: it was me, I was the developer that struggled. I still struggle though, but this means I still have things to learn, which is great!
; HOD-symantec-firewall-DoS-expl.asm: | |
; Symantec Multiple Firewall DNS Response Denial-of-Service | |
; ------------------------------------------------------------------- | |
; By f.shiri 2020 | |
; [email protected] | |
; ------------------------------------------------------------------- | |
; Tested on: | |
; - Symantec Norton Personal Firewall | |
; Systems Affected: | |
; ------------------------------------------------------------------- |