Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stylus/node/index.js')
-rw-r--r--examples/stylus/node/index.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/stylus/node/index.js b/examples/stylus/node/index.js
new file mode 100644
index 0000000..896c9c2
--- /dev/null
+++ b/examples/stylus/node/index.js
@@ -0,0 +1,23 @@
+const fs = require('fs');
+const stylus = require('stylus');
+
+
+sass.render({
+ file: 'src/main.sass', outFile: 'dest/main.css',
+ }, function (error, result) { // node-style callback from v3.0.0 onwards
+ if (!error) {
+ // No errors during the compilation, write this result on the disk
+ fs.writeFile('dest/main.css', result.css, function (err) {
+ if (!err) {
+ console.log('Responsive font sizes generated.');
+ }
+ else {
+ throw err;
+ }
+ });
+ }
+ else {
+ throw error;
+ }
+ }
+);