How to access atom-shell APIs within AngularJS? (For opening a file save dialog)


I posted this question on StackOverflow, just wondering if anyone here has any ideas/feedback about how to access atom-shell APIs (like ‘dialog’) from within an AngularJS app:



Oh, just found the remote module, d’oh!


Hi @dkmooers Can you outline how you went about setting up the save to CSV functionality using the remote module? Did you open a new BrowserWindow and update it’s contents to be something like encodeURI('data:text/csv;charset=utf-8' + CSVString); ?



// app.js

var fs = require('fs');
var csv = require('csv');
var remote = require('remote');

// CSV download code, after you've built the csv as a string

remote.require('dialog').showSaveDialog( { 
	title:'Export Clients Spreadsheet',
	filters: [
		{ name: 'Spreadsheet', extensions: ['csv'] },
}, function(filePathAndName) {
	fs.writeFile(filePathAndName, csv, function(err) {
		if (!err) {
			alert('Clients spreadsheet exported successfully!');


Perfect, thank you!


@joshcarr Yeah definitely!