diff --git a/lib/daemon.js b/lib/daemon.js
index <HASH>..<HASH> 100644
--- a/lib/daemon.js
+++ b/lib/daemon.js
@@ -1,5 +1,7 @@
 import readline from 'readline';
 
+import Importer from './Importer';
+
 export default function daemon() {
   const rlInterface = readline.createInterface({
     input: process.stdin,
@@ -7,7 +9,17 @@ export default function daemon() {
     terminal: false,
   });
 
-  rlInterface.on('line', (str: string) => {
-    console.log('You just typed: ' + str);
+  rlInterface.on('line', (jsonCommand: string) => {
+    const command = JSON.parse(jsonCommand);
+    const importer = new Importer(
+      command.fileContent.split('\n'), command.pathToFile);
+
+    // TODO: don't automatically invoke function here because of security issues
+    importer[command.command](...command.args).then((result) => {
+      process.stdout.write(`${JSON.stringify(result)}\n`);
+    }).catch((error) => {
+      // TODO: print entire stack trace here
+      process.stderr.write(error.toString());
+    });
   });
 }
Make daemon use Importer

This brings us closer to having importjsd work as a real daemon for
importjs.