Created
September 19, 2012 02:40
-
-
Save jasonkuhrt/3747347 to your computer and use it in GitHub Desktop.
meteor yaml package file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Package.describe({ | |
summary: "yaml to js" | |
}); | |
var js_yaml = require('js-yaml'); | |
var fs = require('fs'); | |
Package.register_extension("yaml", function (bundle, source_path, serve_path, where) { | |
serve_path = serve_path + '.js'; | |
var contents = fs.readFileSync(source_path); | |
contents = new Buffer(js_yaml.load(contents.toString('utf8'))); | |
bundle.add_resource({ | |
type: "js", | |
path: serve_path, | |
data: contents, | |
where: where | |
}); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment