# Write to your local file system using a Postman Collection

We’ve seen it’s super useful to [use an inbound webhook to pipe information gathered by Postman to a Slack channel](https://blog.postman.com/2017/08/15/keep-track-of-github-issues-using-a-postman-collection/) for scheduled collection runs. For development, you can also log data to the [Postman console](https://learning.postman.com/docs/postman/sending-api-requests/debugging-and-logs/#network-calls-with-postman-console). But, what if you want to export the data resulting from a Postman collection run to CSV or JSON? **Related: [Use the Write Responses to File Template](https://www.postman.com/templates/collections/write-responses-to-file/)**### **Output data to CSV or JSON**

 Here’s an example of using [Newman to run a collection and writing the file to your disk](https://github.com/postmanlabs/postman-app-support/issues/3033#issuecomment-301758179). Another easy way to export and log data is by running a local server, and then using scripts in Postman to build a request to send to that server. We'll walk through that process in 2 simple steps.> ***POSTMAN TIP*** **&gt;&gt; Run a local server, and use scripts in Postman to build a request to send to that server.**

### [![](https://blog.postman.com/wp-content/uploads/2017/08/localNodeServer-1.png)](https://blog.postman.com/wp-content/uploads/2017/08/localNodeServer-1.png)

### **Start your local server**

 For this Node.js example, make sure you have [Node.js](https://nodejs.org/en/download/) and [npm](https://www.npmjs.com/package/download) package manager installed on your machine. This example uses Node.js, but your script can be in any language.  This script is an example of how to start a server, listen for `POST` requests, and write the data to your file system. Let's create a new file called `script.js`: https://gist.github.com/loopDelicious/213881bc1d4c8f64e1404aa7c7cbb413 From the command line, install any dependencies and run the script to start your local server. `  $ npm install express fs body-parser` `  $ node script.js ` In this example, `script.js` is the file created in the previous step. ### **Run the Postman collection**

 Click the **Run in Postman** button to import the collection and corresponding environment. Check out the collection documentation for step-by-step instructions to get started.

  Run the Postman collection to make a `GET` request and then make a `POST` request to your local server.### **Local server writes to file**

 Your local server will receive the POST request initiated by running the Postman collection and your local script will write this to your file system, as `spaceReport.json`.  And we have lift off! [![](https://blog.postman.com/wp-content/uploads/2017/08/liftoff.jpeg)](https://blog.postman.com/wp-content/uploads/2017/08/liftoff.jpeg) By running on a local server, and then using scripts in Postman to build a request to send to that server, you can write to your file system or even log entries in a local database. **Note:** this solution works because we are running our collection on a local instance of the Postman app, using an internal network request. We can not do this running our collection using a scheduled Postman Monitor because the collection runs on the Postman cloud, which cannot access your local server. However, we could do this [running a local collection file using Newman](https://github.com/postmanlabs/postman-app-support/issues/3033#issuecomment-301758179). [![](https://blog.postman.com/wp-content/uploads/2017/08/Screen-Shot-2017-08-28-at-1.54.04-PM.png)](https://blog.postman.com/wp-content/uploads/2017/08/Screen-Shot-2017-08-28-at-1.54.04-PM.png)