{"id":20937145,"url":"https://github.com/danibram/bumblebee","last_synced_at":"2026-04-25T00:38:10.084Z","repository":{"id":24192547,"uuid":"27583690","full_name":"danibram/bumblebee","owner":"danibram","description":"Object transformation tool","archived":false,"fork":false,"pushed_at":"2017-04-25T05:39:50.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T16:47:02.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/danibram/bumblebee","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/danibram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-05T09:13:51.000Z","updated_at":"2015-03-06T15:31:38.000Z","dependencies_parsed_at":"2022-09-15T22:23:25.331Z","dependency_job_id":null,"html_url":"https://github.com/danibram/bumblebee","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/danibram/bumblebee","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fbumblebee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fbumblebee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fbumblebee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fbumblebee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danibram","download_url":"https://codeload.github.com/danibram/bumblebee/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danibram%2Fbumblebee/sbom","scorecard":{"id":319113,"data":{"date":"2025-08-11","repo":{"name":"github.com/danibram/bumblebee","commit":"2ec1b48e35762f97af59a20faaf03af8294c653b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"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"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-MIT:0","Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T00:57:08.703Z","repository_id":24192547,"created_at":"2025-08-18T00:57:08.703Z","updated_at":"2025-08-18T00:57:08.703Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32246396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-18T22:33:23.452Z","updated_at":"2026-04-25T00:38:10.056Z","avatar_url":"https://github.com/danibram.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Coverage Status](https://coveralls.io/repos/danibram/bumblebee/badge.png?branch=master)](https://coveralls.io/r/danibram/bumblebee?branch=master) [![Dependency Status](https://david-dm.org/danibram/bumblebee.svg)](https://david-dm.org/danibram/bumblebee)\n\n[![Bumblebee javascript object transformation tool](http://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Bumblebee_%288023382295%29.jpg/320px-Bumblebee_%288023382295%29.jpg)](https://github.com/danibram/bumblebee)\n\n# bumblebee\n\nObject transformation tool inspired on mongoose models. The basic idea is to contruct a result object, form a model and a reference object (and also you can pass an object as base).\n\n## Getting Started\nInstall the module with: `npm install bumblebee`\n\n```javascript\n    var bumblebee = require('bumblebee-object-transformation');\n    bumblebee(initialObject, referenceObject, model, function(err, result){\n        console.log(result);\n        //Your code....\n    });\n```\n\n## Documentation\nBasically you should use as model the final object, and field by field you can speficy:\n\n-  ```__format``` : (to specify the default format)\n-  ```__default``` : (if bumblebee dont find the field you can specify a default field)\n-  ```__composer``` : (to make some operations predefined)\n-  ```__scheema``` : (to compose the scheema of this field)\n-  ```__originField```: (to specify the orifinal field inside the object, remeber that any scheema that you define inside the composer use their own element or subobject as reference)\n-  ```__clean``` : (to use over the object selected my object cleaner, that removes innecesarry arrays with lenght 0, really usefull when you convert from xml to js.)\n\nFor now the operations are:\n- RegEx : to find inside the object a fields and put in an array.\n- everyElement : to loop over the elements of an array and make the transformations\n- everyElementToArray : to loop over the elements of an array and create an object, you need to specify the key of the every element (__key)\n\nRemember that this module is underconstruction, if you have some needs try to follow the essential structure of the application, and i try to merge all request. Usully i use this module, so im adapting frecuently, and sometimes wont be really well optimized, all suggestions are welcome.\n\nThanks!\n\n\n## Examples\n###_(From 0.3.X Examples)_\n```javascript\n    initialObject = {};\n    var referenceObject = {\n        'title' : 'title',\n        'text': 'hey im a text',\n        'position' : [ 41.3901566, 2.1355214 ],\n        'you' : {\n            'video' : {\n                'active': true,\n                'times': 4,\n                'information':{\n                    'duration': 10,\n                    'format': 'min'\n                }\n            }\n        },\n        'youtube':{\n            'expiration': 'DATE',\n            'expirationTimezone': 'GMT+1'\n        },\n        'buyNowConfig': {\n            'price': 100\n        },\n        'product':{\n            'images':[\n                { url: 'http://lkjljklkj/123'},\n                { url: 'http://lkjljklkj/456'},\n                { url: 'http://lkjljklkj/678'},\n                { url: 'http://lkjljklkj/999'},\n            ]\n        },\n        providers:[{\n            '$': {\n                key: 'acme',\n                type: 'company'\n            },\n            ids: ['123']\n        },{\n            '$': {\n                key: 'octo',\n                type: 'company'\n            },\n            ids: '345'\n        }]\n    };\n    var model = {\n        'position': {\n            __format: 'Object',\n            __scheema: {\n                lat: { __format: 'Float', __originField: 'position.0' },\n                lng: { __format: 'Float', __originField: 'position.1' }\n            }\n        },\n        'youtube': {\n            __scheema:{\n                'active': { __format: 'Boolean', __originField: 'you.video.active'},\n                'times': { __format: 'Integer', __originField: 'you.video.times'},\n                'duration': { __format: 'Integer', __originField: 'you.video.information.duration'},\n                'expiration': { __format: 'String', __originField: 'youtube.expiration'},\n                'expirationTimezone': { __format: 'String', __originField: 'youtube.expirationTimezone'},\n            }\n        },\n        'products': {\n            __format: 'Array',\n            __scheema: {\n                'title': { __format: 'Object' },\n                'text': { __format: 'Object' },\n                'imagePath': { __format: 'String', __originField: 'images.0.url', __outputMod: function (url) { return url+ \".jpg\" } },\n                'buyNowPrice': { __format: 'Float', __originField: 'buyNowConfig.price' }\n            }\n        },\n        'images' : {\n            __format: 'Array',\n            __originField: 'product.images',\n            __composer:{\n                __type: 'everyElement',\n                __scheema: {\n                    'type': { __format: 'String', __default: 'internal' },\n                    'fullUrl': { __format: 'String', __originField: 'url', __outputMod: function (url) { return url+ \".jpg\" } }\n                }\n            }\n        },\n        'providers' : {\n            __format: \"Object\",\n            __composer:{\n                __type: 'everyElementToObject',\n                __originField: 'providers',\n                __key: '$.key',\n                __scheema: {\n                    type:{\n                        __format: 'String',\n                        __originField: '$.type'\n                    },\n                    codes: {\n                        __format: 'Array',\n                        __originField: 'ids'\n                    }\n                },\n            }\n        }\n    };\n```\n  Passing this 2 objects the module reconstruct this in the output:\n```javascript\n\nresult = {\n    position: {\n        lat: 41.3901566,\n        lng: 2.1355214\n    },\n    youtube : {\n        active: true,\n        times: 4,\n        duration: 10,\n        expiration: 'DATE',\n        expirationTimezone: 'GMT+1'\n    },\n    products: [\n        {\n        title: 'title',\n        text: 'hey im a text',\n        imagePath: 'http://lkjljklkj/123.jpg',\n        buyNowPrice: 100\n        }\n    ],\n    images: [\n        { type: 'internal', fullUrl: 'http://lkjljklkj/123.jpg' },\n        { type: 'internal', fullUrl: 'http://lkjljklkj/456.jpg' },\n        { type: 'internal', fullUrl: 'http://lkjljklkj/678.jpg' },\n        { type: 'internal', fullUrl: 'http://lkjljklkj/999.jpg' }\n    ],\n    providers:{\n        acme: {\n            type: 'company',\n            codes: ['123']\n        },\n        octo: {\n            type: 'company',\n            codes: ['345']\n        }\n    }\n}\n\n```\n###_(From 0.2.1 Examples)_\n```javascript\n    initialObject = {\n        _id: \"000001\"\n    };\n    referenceObject = {\n        Name: 'dummy',\n        number: '1243',\n        latitud: '12.43',\n        Active: 'true',\n        image1: 'http://urltoimage1',\n        image2: 'http://urltoimage2',\n        image3: 'http://urltoimage3',\n        image4: 'http://urltoimage4',\n        codes:[\n            {cod1: '111', cod2:'11'},\n            {cod1: '333', cod2:'11'},\n            {cod1: '444', cod2:'22'},\n            {cod1: '555', cod2:'22'}\n        ]\n    };\n    model = {\n        name: {type: 'String', originField: 'Name'},\n        code: {type: 'Integer', originField: 'number'},\n        active: {type: 'Boolean', originField: 'Active'},\n        images: {type: 'Array', composer:{type: 'RegEx', reg: 'image', use: 'value'}},\n        latitud: {type: 'Float'},\n        maybeValue: {type: 'Integer', default: 0},\n        propertyCodes: {\n            type: 'Array',\n            originField: 'codes',\n            composer:{\n                type: 'everyElement',\n                scheema: {\n                    providerCode: {type: 'String', originField: 'cod1'},\n                    providerType: {type: 'String', originField: 'cod2'}\n                }\n            }\n        }\n    };\n  ```\n  Passing this 2 objects the module reconstruct this in the output:\n  ```javascript\n  result = {\n    _id: \"000001\",\n      name: 'dummy',\n      code: 1243,\n      active: true,\n      images: [\n        'http://urltoimage1',\n        'http://urltoimage2',\n        'http://urltoimage3',\n        'http://urltoimage4'\n     ],\n      latitud: 12.43,\n      maybeValue: 0,\n      propertyCodes:[\n        { providerCode: '111', providerType: '11' },\n        { providerCode: '333', providerType: '11' },\n        { providerCode: '444', providerType: '22' },\n        { providerCode: '555', providerType: '22' }\n    ]\n}\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n####(0.3.9 Lastest)\n- Added everyElementToObject basically its the same that every element and you need to specify the key of the object for every element\n- Added inside the everyElement of an array the posibilty to use a \"__outputMod\" function\n- Added inside the everyElement with __scheema the __condition function, if true the element should be inject on the final everyElement array\n- Fixed little problem with composer and array without __scheema field.\n\n####(0.3.0)\nModels:\n- (0.3.0) _(From 0.2.1 to 0.3)_ Not more type to define the output format, simply format.\n- (0.3.0) _(From 0.2.1 to 0.3)_ All internal operators are rewrite with \"__\" to remove comflicts\n\nOperations:\n- (0.3.0) Now added the scheema operation that allows you to compose objects.\n\n## License\nCopyright (c) 2014 Daniel Biedma Ramos\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanibram%2Fbumblebee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanibram%2Fbumblebee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanibram%2Fbumblebee/lists"}