feathers-hooks-csvtoarray
Feathers hook for converting a comma-delimited list to an Array of strings.
Installing
Simply run npm install --save feathers-hooks-csvtoarray
and you're good to go!
Usage
Important: As of version 0.1.0, this hook is intended to use with Sequelize. Further versions will move the coupling code to hook configurations.
Require the hook:
const csvToArray = ;
Then, choose which fields in your Sequelize Model should be parsed by the hook, adding the option csvAsArray: true
:
// things.model.jsconst Sequelize = ; module { const sequelizeClient = app; const things = sequelizeClient; return things;};
Finally, bind the hook to the model's service.
app;
TODOs
Check out the issues.
Feel like contributing?
Knock yourself out! Fork the repo and make a PR.
Licence
MIT