Skip to content

Latest commit

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

yamlify

YAML (.yaml, .yml) files support for browserify and node.
With feature to include yaml files into each other.

YAML support for browserify and node.js

Yamlify!

// server.jsvarbrowserify=require('browserify');varyamlify=require('yamlify');b=browserify();b.add('./client.js');b.transform(yamlify);

Add ability to require YAML files in Node.js

// server.jsrequire('yamlify/register');

After that you can require yaml wherever you want:

// client.js or server.jsvarconstants=require('./constants.yaml');

YAML files inclusions

This plugin also adds an ability to include yaml files into each other.

Lets say you want to keep some data in a partial file:

# _films.yaml- &terminatorname: Terminator 2 year: 1991
- name: Avataryear: 2009

You can include a whole .yaml file into another one like this:

# director.yamlname: James Cameron films: !include ./_films 

You can also include a particular anchor from the specified file:

# me.yamlname: John SmithfavouriteFilm: !include ./_films *terminator

licence

MIT

About

YAML for browserify and node.js; YAML includes

Resources

Stars

28 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages