This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Sergey Voronov
Posted Oct 04 - Read on Facebook

writing a module and stuck on exporting class:( whats the syntax for that?

3 Comments

Kevyn Arnott

class exports.Component extends Layer

Niels van Hoorn

In general, you can export anything by setting it as a property on the exports object. The example Kevyn gave is just a shorthand for that.
So you can do the the same file

exports.pi = 3.141592645

exports.sum = (a, b) ->
. a + b

exports.name = "Sergey"

class Test extends Layer
...

exports.ExternalNameForTest = Test

Sergey Voronov

i forgot to include module name as prefix in class in prototype, sorted now)

Read the entire post on Facebook