1.1.1 • Published 7 years ago

@kevinrambaud/csv-to-sitemap v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

csv-to-sitemap

Simple node.js package allowing to convert a csv content to a sitemap.xml content.

Installation

Make sure you have node installed with npm.

$ npm i @kevinrambaud/csv-to-sitemap --save

or if you use yarn package manager

$ yarn add @kevinrambaud/csv-to-sitemap

Usage

Based on the fact that you have a file intitled myfile.csv next to your js file.

myfile.csv

loc;lastmod
http://kevinrambaud.com;2017-08-01
http://kevinrambaud.com/hi;2017-08-01

index.js

// Import module
const { promisify } = require('util');
const { readFile } = require('fs');
const { convertToXml } = require('@kevinrambaud/csv-to-sitemap');

// Transform in promise the readFile function
const readFileAsync = promisify(readFile);

// Convert the csv file
readFileAsync('./myfile.csv', 'utf8')
  .then(csvContent => convertToXml(csvContent))
  .then(xmlContent => console.log(xmlContent))
  .catch(err => console.error(err));

Contributing

  1. Fork it
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Credits

All awesome developers that created each pieces used into this project.

Authors

  • Kevin Rambaud - Initial work - website

See also the list of contributors who participated in this project.

License

MIT

1.1.1

7 years ago

1.1.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago