Search thousands of free JavaScript snippets that you can quickly copy and paste into your web pages. Get free JavaScript tutorials, references, code, menus, calendars, popup windows, games, and much more.
nodejs os module
const os = require('os');
var totalMemory = os.totalmem();
var freeMemory = os.freemem(); console.log(`Total Memory: ${totalMemory}`);
console.log(`Free Memory: ${freeMemory}`);
nodejs path module
const path = require('path'); var pathObj = path.parse(__filename); console.log(pathObj);> node path-module.js
{ root: 'C:\\',
dir: 'C:\\Users\\Edward Lance Lorilla\\Documents\\node-practice',
base: 'path-module.js',
ext: '.js',
name: 'path-module' }
multipart element ui
<form name="documentForm" ref="form" @submit.prevent = "store$" method="post" enctype="multipart/form-data">
<el-upload :on-change="handleChange" :file-list="create$.file" action="" class="upload-demo" ref="upload" multiple :auto-upload="false"> <v-btn slot="trigger">Upload</v-btn> </el-upload>
<v-btn color="blue darken-1" flat form="documentForm" type="submit">Save</v-btn>
</form>
new Vue({methods:{store$(){ var vm = this var store$ = new FormData(vm.$refs.form); store$.append('category_id', vm.create$.category_id ) _.map(vm.create$.file, function(data){ store$.append('file[]', data.raw ) }) post('/api/documents', store$).then(function (response) { vm.$set(vm.$root.$data.documents, vm.$root.$data.documents.length, response.data ) vm.$root.successResponse('Create A Document') vm.$router.push('/documents') }).catch(function (_ref2) { vm.$root.errorResponse(_ref2) });}
})
creating and loading a module nodejs
//app.js
//logger.js
var logger = require('./logger.js');logger('edward');
//logger.js
var url = 'edward.io';function log(message) { console.log(message) } module.exports = log;
Subscribe to:
Posts (Atom)
Lessons from 1,000+ YC startups: Pivoting, resilience, avoiding tar pit ideas, more | Dalton Caldwell (Y Combinato…
Dalton is Managing Director and Group Partner at Y Combinator. He’s advised more than 35 YC unicorns, including DoorDash, Amplitude, Webflow...