0

I want to use code written in one.coffee file in one more coffee file two.coffee , just like include function present in Php

I am working on casperjs with coffee script

Rohan
  • 1
  • 2
  • `require` is also available in coffeescript. – Artjom B. Sep 02 '15 at 07:21
  • possible duplicate of [Is 'require(...)' a common javascript pattern or a library function?](http://stackoverflow.com/questions/11551861/is-require-a-common-javascript-pattern-or-a-library-function) – Artjom B. Sep 02 '15 at 07:22
  • So should I use it like file=require('B.coffee') – Rohan Sep 02 '15 at 10:35
  • I don't know. Try `require('B.coffee')`, `require('B')` and `require('./B')` – Artjom B. Sep 02 '15 at 10:38
  • Thanks Artjom B its working , but how to use it with casperjs , i have my casperjs code in B.coffee file – Rohan Sep 03 '15 at 05:19
  • I don't understand. If it's working, then you are already using it with CasperJS, don't you? Can you describe what your problem is exactly? – Artjom B. Sep 03 '15 at 09:33

0 Answers0