Skip to content

Commit

Permalink
docs: fixed example in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
claylo committed Oct 3, 2016
1 parent ef07854 commit d7a2e7d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ A very small script can be created to leverage the `yaml-include` tags. The scri
var yaml = require('js-yaml');
var yamlinc = require('yaml-include');
var fs = require('fs');
var p = require('path');

// move to the top level of the base yaml document
// if necessary
process.chdir(__dirname + '/yaml-dir');
// set the base file for relative includes
yamlinc.setBaseFile(p.join(__dirname, 'yaml-dir', 'base.yaml'));

var src = fs.readFileSync('base.yaml', 'utf8');
var src = fs.readFileSync(yamlinc.basefile, 'utf8');

var obj = yaml.load(src, { schema: yamlinc.YAML_INCLUDE_SCHEMA });
var obj = yaml.load(src, { schema: yamlinc.YAML_INCLUDE_SCHEMA, filename: yamlinc.basefile });

// use your loaded object!
```
Expand Down Expand Up @@ -142,4 +142,4 @@ NOTE: Files are permitted to include other files or directories. Just make sure

## License

View the [LICENSE](claylo/yaml-include/LICENSE) file (ISC).
View the [LICENSE](claylo/yaml-include/LICENSE) file (ISC).

0 comments on commit d7a2e7d

Please sign in to comment.