项目作者: monsterkodi

项目描述 :
structured data search
高级语言: CoffeeScript
项目地址: git://github.com/monsterkodi/sds.git
创建时间: 2015-11-19T17:47:28Z
项目社区:https://github.com/monsterkodi/sds

开源协议:

下载


icon

usage

list

list

search

suche die struktur

  1. sds = require 'sds'
  2. # test against sds.extnames [list of supported file extensions]
  3. if path.extname(infile) in sds.extnames
  4. # load object from file
  5. obj = sds.load infile
  6. # find something ...
  7. sds.find.value obj, '*value'
  8. sds.find.key obj, '*key'
  9. sds.find.path obj, '*path'
  10. sds.find.keyValue obj, '*key', '*value'
  11. sds.find.pathValue obj, '*path', '*value'
  12. # all find methods return a list of keypaths
  13. # each keypath is in itself a list of strings
  14. #
  15. # use sds.get to retrieve the value at a keypath
  16. sds.get obj, keypath
  17. # use stringify to convert to any of the supported formats
  18. sds.stringify obj, ext: 'yaml'
  19. # or save to disk (format is deduced from extension)
  20. sds.save outfile, obj
  21. # happy searching :-)

npm package
Build Status
downloads
Dependencies Status