Javascript

December 7, 2019 Programming 1 minute, 15 seconds

glob.sync("../*/*.xlsm").forEach(function (file) {
    console.log(file)
});

dirs = FS.readdirSync(path)

let date = moment("01/23/18", ["MM/DD/YY", "M/DD/YY", "MM/D/YY", "M/D/YY"], true)
if (date.isValid()) {
    console.log(date.format("DD.MM.YY"))
}

if (typeof(variable) != "undefined" && variable) {
    console.log("Good")
}

for (let input of inputs) {
    console.log(input)
}

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
</head

Add to your entrypoint the following snippet

require('source-map-support').install()
npm install dev-dependencies source-map-support

index.html

<script type="text/javascript">app.main()</script>
<body>
    <form>
        <select id="year" name="year">
            <option value="2017">2017</option>
            <option selected="selected" value="2018">2018</option>
        </select>
    </form>

app.js

static main () {
    $(document).ready(() => {
        this.draw() // do stuff
        $("#year").change(() => {
            this.draw()
        })
    })
}

document.getElementById("id").value = data

npm list -g --depth=0
npm uninstall -g MODULE

Remove all global modules:

del %APPDATA%\npm
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm

Automatically check your dependencies in your package.json for vulnerabilites

npm install auditjs -g

npm config [--global] set|delete strict-ssl false|true
npm config [--global] set|delete cafile CAFILE
npm config [--global] set|delete proxy PROXY
npm config [--global] set|delete https-proxy PROXY

npm config set strict-ssl false

npm config set loglevel error