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.
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
| # mount volume PWD on host to /app in container. | |
| shai@lappy ~/tmp/example-working-docker-compose-environment-vars [master *] ± % cat docker-compose.yml | |
| version: "3" | |
| services: | |
| some_server: | |
| ... | |
| volumes: | |
| - $PWD:/app |
If you hate git submodule, then you may want to give git subtree a try.
When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.
When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.
Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
| #!/usr/bin/env bash | |
| # Lets you `cd 'iCloud Drive'` from your home directory, | |
| # or `cd ~/iCloud\ Drive` from elsewhere. | |
| ln -sv ~/Library/Mobile\ Documents/com~apple~CloudDocs/ ~/iCloud\ Drive | |
| chflags -h hidden ~/iCloud\ Drive |
| #!/usr/bin/python | |
| apiVersion = 'v5' | |
| apiURL = 'https://api.thousandeyes.com' | |
| urlBase = apiURL + '/' + apiVersion + '/' | |
| logLevel = 3 | |
| requestCount = 0 | |
| uploadLimit = 10000 |
| /** | |
| * Encodes multi-byte Unicode string into utf-8 multiple single-byte characters | |
| * (BMP / basic multilingual plane only). | |
| * | |
| * Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars. | |
| * | |
| * Can be achieved in JavaScript by unescape(encodeURIComponent(str)), | |
| * but this approach may be useful in other languages. | |
| * | |
| * @param {string} unicodeString - Unicode string to be encoded as UTF-8. |
| "Ciribim ciribom" | |
| Ciribim ciribom | |
| älä luule että uskotaan | |
| Ciribim ciribom | |
| sua enää ollenkaan | |
| Tytön täytyy ymmärtää | |
| se milloin häntä narrataan |
