---
title: "nodejs运行coffeescript"
author: "biyeah"
date: "2011-12-10T03:05:58Z"
tags: []
categories: ["编程语言"]
slug: "nodejs-coffeescript"
draft: false
lastmod: "2011-12-10T03:17:04Z"
id: 1300680
url: "https://biyeah.iteye.com/blog/1300680"
---

首先安装coffee-script

> npm install coffee-script


在js文件中加入下面代码

```javascript
require('coffee-script');//引用coffeescript模块
require('./mytest');//指向要运行的coffeescript文件，可加多个文件。
```


就可以node xx.js，来运行coffeescript文件了。