What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-14 23:48:01
node js download file to folder
var http = require('http'); var fs = require('fs'); var download = function(url, dest, cb) { var file = fs.createWriteStream(dest); var request = http.get(url, function(response) { response.pipe(file); file.on('finish', function() { fil... Add solution -
Javascript 2021-09-10 16:11:01
small vedios 1 min
// Requires "request" to be installed (see https://www.npmjs.com/package/request) var request = require('request'); var fs = require('fs'); request.post({ url: 'https://api.remove.bg/v1.0/removebg', formData: { image_file: fs.createRead... Add solution -
Javascript 2021-09-10 04:05:02
node js store add values in file
var fs = require('fs'); var myOptions = { name: 'Avian', dessert: 'cake' flavor: 'chocolate', beverage: 'coffee' }; var data = JSON.stringify(myOptions); fs.writeFile('./config.json', data, function (err) { if (err) { console.log('There h... Add solution -
Javascript 2021-09-07 16:59:02
how to right plain text format file in node js
var fs = require('fs') var logger = fs.createWriteStream('log.txt', { flags: 'a' // 'a' means appending (old data will be preserved) }) logger.write('some data') // append string to your file logger.write('more data') // again logger.write('and more') ... Add solution -
Javascript 2021-08-28 06:44:02
nodejs watermark image
//Install npm install imaginary --save //Import var fs = require('fs') var imaginary = require('imaginary') var serverUrl = 'localhost:8080' imaginary('myImage.jpg') .server(serverUrl) .watermark({ text: 'copyright' }) .on('error', function (err)... Add solution