Skip to main content

A small Flask extension that makes it easy to use CoffeeScript with your Flask application.

Usage

You can activate it by calling the coffee2js function with your Flask app as a parameter:

from flaskext.coffee2js import coffee2js coffee2js(app, js_folder=’js’, coffee_folder=’src/coffee’)

This will intercept the request to js_folder and compile de file if is necesary using the files from coffee_folder.

When you deploy your app you might not want to accept the overhead of checking the modification time of your .coffee and .jss files on each request. A simple way to avoid this is wrapping the coffee2js call in an if statement:

if app.debug:

from flaskext.coffee2js import coffee2js coffee2js(app)

If you do this you’ll be responsible for rendering the .coffee files into .js when you deploy in non-debug mode to your production server.

Release files for flask-coffee2js 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-coffee2js 0.1.2
File Size Uploaded
flask-coffee2js-0.1.2.zip 5.8 kB Details

Release files / flask-coffee2js-0.1.2.zip

Download URL flask-coffee2js-0.1.2.zip
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e1a71f5666e5f4647666429bd41ad3beafb65be0e598fc6dfb6d42d96c2f2c46
BLAKE2b-256 checksum
How to use checksums
5831429fc5270256c9cf75187ebb298c3923037be923cd8662bb3e5641c769c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page