path-object

2018-10-11 admin

path-object是什么

什么是path-object,access object keys with a path

path-object使用教程帮助文档

path-object

Build Status

Install

$ npm install -S path-object

Example

var PathObject = require('path-object')()

var fileObj = new PathObject()

fileObj.set('path/to/file1', 'file1 content')
fileObj.set('path/to/file2', 'file2 content')
fileObj.set('path/to/my/extra/info', 'more info')
fileObj.set('another/path/to/file', 'another file content')

console.log('dump:', fileObj.dump())

fileObj.remove('path/to/file2/extra/info')

console.log('dump with scope:', fileObj.dump('path'))

console.log('get by path:', fileObj.get('another/path/to/file'))

Licence

The MIT License (MIT)

Copyright © 2015 Christoph Witzko

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-42434.html

文章标题:path-object

回到顶部