Installations
npm install cnd-parser
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
0.12.x
Node Version
0.12.4
NPM Version
2.10.1
Score
71.1
Supply Chain
98.8
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
DracoBlue
Download Statistics
Total Downloads
1,477
Last Day
1
Last Week
6
Last Month
26
Last Year
269
GitHub Statistics
5 Commits
3 Watching
1 Branches
1 Contributors
Bundle Size
3.75 kB
Minified
1.22 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.1.0
Package Id
cnd-parser@0.1.0
Size
5.37 kB
NPM Version
2.10.1
Node Version
0.12.4
Total Downloads
Cumulative downloads
Total Downloads
1,477
Last day
0%
1
Compared to previous day
Last week
-45.5%
6
Compared to previous week
Last month
8.3%
26
Compared to previous month
Last year
77%
269
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
cnd-parser
cnd-parser is copyright 2015 by DracoBlue http://dracoblue.net
What is cnd-parser?
This is a small (nodejs/browserify) library for parsing CND-Strings (defined in jsr-170 and explained at jackrabbit).
This implementation doesn't support the full CND-syntax.
Limitations
- constraints and default values are not supported
- each property and childnode needs to be defined on one row
- shortcuts (like m for multiple) are not supported
- the library does no validation for nodetype, property or childnode options
Example
This example:
1<ns = 'http://namespace.com/ns'> 2[ns:NodeType] > ns:ParentType1, ns:ParentType2 3 orderable mixin 4 - ex:property (string) primary mandatory autocreated protected multiple version 5 + ns:node (ns:reqType1, ns:reqType2) mandatory autocreated protected multiple version 6[nt:resource] > mix:referenceable 7 - jcr:encoding 8 - jcr:mimeType mandatory 9 - jcr:data (binary) mandatory 10 - jcr:lastModified (date) mandatory ignore
can be parsed (in nodejs) like this:
1cnd = cndParser.parseString('/* string here! */');
2console.log(JSON.stringify(cnd.getNodeTypes(), null, 4));
Output:
1[ 2 { 3 "options": { 4 "orderable": true, 5 "mixin": true 6 }, 7 "properties": [ 8 { 9 "options": { 10 "primary": true, 11 "mandatory": true, 12 "autocreated": true, 13 "protected": true, 14 "multiple": true, 15 "version": true 16 }, 17 "namespacedName": "ex:property", 18 "localName": "property", 19 "namespace": "ex", 20 "types": [ 21 "string" 22 ] 23 } 24 ], 25 "childNodes": [ 26 { 27 "options": { 28 "mandatory": true, 29 "autocreated": true, 30 "protected": true, 31 "multiple": true, 32 "version": true 33 }, 34 "namespacedName": "ns:node", 35 "localName": "node", 36 "namespace": "ns", 37 "types": [ 38 "ns:reqType1", 39 "ns:reqType2" 40 ] 41 } 42 ], 43 "namespacedName": "ns:NodeType", 44 "localName": "NodeType", 45 "namespace": "ns", 46 "superTypes": [ 47 "ns:ParentType1", 48 "ns:ParentType2" 49 ] 50 }, 51 { 52 "options": {}, 53 "properties": [ 54 { 55 "options": {}, 56 "namespacedName": "jcr:encoding", 57 "localName": "encoding", 58 "namespace": "jcr" 59 }, 60 { 61 "options": { 62 "mandatory": true 63 }, 64 "namespacedName": "jcr:mimeType", 65 "localName": "mimeType", 66 "namespace": "jcr" 67 }, 68 { 69 "options": { 70 "mandatory": true 71 }, 72 "namespacedName": "jcr:data", 73 "localName": "data", 74 "namespace": "jcr", 75 "types": [ 76 "binary" 77 ] 78 }, 79 { 80 "options": { 81 "mandatory": true, 82 "ignore": true 83 }, 84 "namespacedName": "jcr:lastModified", 85 "localName": "lastModified", 86 "namespace": "jcr", 87 "types": [ 88 "date" 89 ] 90 } 91 ], 92 "childNodes": [], 93 "namespacedName": "nt:resource", 94 "localName": "resource", 95 "namespace": "nt", 96 "superTypes": [ 97 "mix:referenceable" 98 ] 99 } 100]
License
The cnd-parser project is licensed under the MIT License. See LICENSE for more information.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More