Parameter | Default | Description |
---|---|---|
PROJECT_NAME | FOLDER_NAME | Name of current folder |
PACKAGE_NAME | PROJECT_NAME | Package name |
PKG_PUBLISH_CONFIG | undefined | restricted or public for scoped packages |
PROJECT_DESCRIPTION | Description | |
AUTHOR | Vitaliy V. Makeev |
|
LICENCE | MIT |
Last active
August 5, 2023 11:28
-
-
Save wmakeev/5862c825dee7da01b9fd251d43dde520 to your computer and use it in GitHub Desktop.
[01 - Node.js base template] #template #env
This file contains hidden or 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
global.FOLDER_NAME = __dirname // TODO |
This file contains hidden or 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
npm i -D @types/node@20 prettier dotenv auto-changelog envalid && git init |
This file contains hidden or 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
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
charset = utf-8 | |
end_of_line = lf | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains hidden or 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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Launch JS", | |
"skipFiles": ["<node_internals>/**"], | |
"envFile": "${workspaceFolder}/.env", | |
"program": "${file}", | |
"internalConsoleOptions": "openOnSessionStart", | |
"outputCapture": "std" | |
} | |
] | |
} |
This file contains hidden or 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
{ | |
"files.exclude": { | |
"node_modules": true | |
}, | |
"explorer.autoRevealExclude": { | |
"**/node_modules": true | |
}, | |
"editor.formatOnSave": true, | |
"editor.formatOnPaste": false, | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"[typescript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"editor.formatOnSaveMode": "file" | |
} |
This file contains hidden or 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
.DS_Store | |
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
# npm | |
node_modules | |
# env | |
.env* | |
!.env.example | |
# temp | |
/__temp |
This file contains hidden or 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
DEBUG=true |
This file contains hidden or 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
DEBUG= |
This file contains hidden or 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 { cleanEnv, num, str } from "envalid"; | |
export const env = cleanEnv(process.env, { | |
FOO: str(), | |
BAR: num({ default: 0 }), | |
}); |
This file contains hidden or 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
{ | |
"name": "%PACKAGE_NAME%", | |
"version": "0.0.0", | |
"description": "%PROJECT_DESCRIPTION%", | |
"scripts": { | |
"env:example": "npx [email protected]", | |
"test": "echo 'No tests'", | |
"version": "npm run env:example && auto-changelog -p && git add CHANGELOG.md .env.example", | |
"release": "np" | |
}, | |
"publishConfig": { | |
"access": "%PKG_PUBLISH_CONFIG%" | |
}, | |
"engines": { | |
"node": ">=14" | |
}, | |
"prettier": { | |
"semi": false, | |
"singleQuote": true, | |
"quoteProps": "consistent", | |
"trailingComma": "none", | |
"arrowParens": "avoid" | |
}, | |
"np": { | |
"yarn": false | |
}, | |
"author": { | |
"name": "%AUTHOR%", | |
"email": "%AUTHOR_EMAIL%" | |
}, | |
"license": "%LICENCE%" | |
} |
This file contains hidden or 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
{ | |
"compilerOptions": { | |
"lib": [ | |
"ES2021" | |
], | |
"noEmit": true, | |
"strict": true, | |
"allowJs": true, | |
"alwaysStrict": true, | |
"checkJs": true, | |
"moduleResolution": "Node", | |
"module": "CommonJS" | |
}, | |
"include": [ | |
"./**/*" | |
] | |
} |
This file contains hidden or 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
{ | |
"a": "b" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment