{"id":23663434,"url":"https://github.com/eyolas/sonata-annotationparser","last_synced_at":"2025-12-06T09:30:25.723Z","repository":{"id":7115210,"uuid":"8409032","full_name":"eyolas/sonata-annotationparser","owner":"eyolas","description":"Parser of annotations","archived":false,"fork":false,"pushed_at":"2013-03-27T21:06:23.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T19:41:41.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyolas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-25T12:50:55.000Z","updated_at":"2014-01-18T13:48:07.000Z","dependencies_parsed_at":"2022-08-23T20:10:34.418Z","dependency_job_id":null,"html_url":"https://github.com/eyolas/sonata-annotationparser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyolas%2Fsonata-annotationparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyolas%2Fsonata-annotationparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyolas%2Fsonata-annotationparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyolas%2Fsonata-annotationparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyolas","download_url":"https://codeload.github.com/eyolas/sonata-annotationparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239662734,"owners_count":19676435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-29T05:28:20.403Z","updated_at":"2025-12-06T09:30:20.463Z","avatar_url":"https://github.com/eyolas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"sonata-annotationparser\n=======================\n\nAnnotation parser for [Node](http://nodejs.org).\n\n## Installation\n\n    $ npm install sonata-annotationparser\n\nInstall from source code repository:\n\n    $ git clone git@github.com:eyolas/sonata-annotationparser.git\n    $ cd sonata-annotationparser\n    $ npm install\n\n## Usage parse one file\n### Definition of annotation in files\n\n* Must be in comment who start by `/**` and finish by `*/`\n* start by `@`\n* value must be wrapped in `(` `)`\n\n### Parsing a file without class of annotation\n\nCreate a new annotation parser.\n\n    var annotationsParser = require('sonata-annotationparser').AnnotationParser;\n    var parser = new annotationsParser();\n    var results = parser.extract(fileName, fileDir);\n\n### Parsing with annotation's class\n\n#### Create an annotation\n\nTestAnnotation.js\nProperty tagName define the annotion\n\n    var AbstractAnnotation = require('sonata-annotationparser').AbstractAnnotation,\n        Utils = require('sonata-annotationparser').UtilsAnnotations,\n\n    function TestAnnotation() {\n        TestAnnotation.super_.call(this);\n        this.tagName = 'Test';\n    }\n\n    inherits(TestAnnotation, AbstractAnnotation);\n\n    TestAnnotation.prototype.run = function(value, target, file, filePath) {\n        //you process\n    };\n\n    module.exports = ScopeAnnotation;\n\n#### Instanciate parser, instanciate annotation, add annotation and extract\n\n    var annotationsParser = require('sonata-annotationparser').AnnotationParser;\n    var parser = new annotationsParser();\n    va myAnno = new require('TestAnnotation')();\n    parser.addAnnotation(myAnno);\n    var results = parser.extract(fileName, fileDir);\n\n\n## Parser of dir\n\n#### Instanciate parser and run\n\n    var Parser = require('sonata-annotationparser').dirParser;\n\n    var parse = new Parser({\"dirs\": './lib', \"execDir\": __dirname});\n    parse.run();\n\nif you want add annotation, you can add an Annotation.json in dir\n\nsample Annotations.json\n\n    {\n        \"Annotations\": [\n            \"../../lib/Annotations/RessourceAnnotation.js\",\n            \"../../lib/Annotations/ScopeAnnotation.js\"\n        ]\n    }\n\n\n## Credits\n\n  - [David Touzet](http://github.com/eyolas)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2013 Touzet David\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyolas%2Fsonata-annotationparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyolas%2Fsonata-annotationparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyolas%2Fsonata-annotationparser/lists"}