{"id":24568922,"url":"https://github.com/bitliner/shared-pack","last_synced_at":"2025-08-17T10:41:18.816Z","repository":{"id":148316505,"uuid":"52161292","full_name":"bitliner/shared-pack","owner":"bitliner","description":"Write code in NodeJS/NPM, compile it for AngularJS/bower.","archived":false,"fork":false,"pushed_at":"2016-07-27T21:42:24.000Z","size":32036,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T05:32:20.854Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitliner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-20T15:55:35.000Z","updated_at":"2016-07-23T00:57:34.000Z","dependencies_parsed_at":"2023-05-19T18:15:18.287Z","dependency_job_id":null,"html_url":"https://github.com/bitliner/shared-pack","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/bitliner/shared-pack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fshared-pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fshared-pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fshared-pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fshared-pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitliner","download_url":"https://codeload.github.com/bitliner/shared-pack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fshared-pack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270837424,"owners_count":24654379,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-01-23T14:55:46.169Z","updated_at":"2025-08-17T10:41:18.797Z","avatar_url":"https://github.com/bitliner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shared-pack\n\nWrite code in [NodeJS](https://nodejs.org/en/)/[NPM](https://www.npmjs.com/), compile it for [AngularJS](https://angularjs.org/)/[bower](https://bower.io/).\n\n\n\n\u003cimg src=\"./docs/usage.gif\"/\u003e\n\n\n# Index\n \n* [`Requirements`](#requirements)\n* [`Installation`](#installation)\n* [`Usage`](#usage)\n\n\u003ca name=\"requirements\" id=\"requirements\"\u003e\u003c/a\u003e\n# Requirements\n\n* npm\n* node.js\n\n\u003ca name=\"installation\" id=\"installation\"\u003e\u003c/a\u003e\n# Installation\n\n`npm install -g shared-pack`\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n# Usage\n\n1. [Create a node.js module](#createModule)\n2. [Compile](#compile)\n3. [Configure properly package.json and bower.json](#setMain)\n\n\u003ca name=\"createModule\"\u003e\u003c/a\u003e\n## Create a javascript module\n\nThe module should satisfy the following 2 conditions:\n\n1. it should be exposed as node.js module - using `module.exports`\n2. the function to expose should be the angular.js function - with dependencies declared as parameters of the function\n\n### Example\n\n1. crete folder: `mkdir shared-module \u0026\u0026 cd $_`\n2. initialize bower.json and package.json `bower init \u0026\u0026 npm init`\n3. create module, example `shared-service.js`:\n \t```\n \t'use strict';\n\n\tfunction SharedService(param1) {\n\t\tconsole.log('Ola', param1);\n\t}\n\n\tmodule.exports = SharedService;\n \t``` \n\n\u003ca name=\"compile\"\u003e\u003c/a\u003e\n## Compile\n\n```\nshared-pack ./shared-service.js\n```\n\n\u003ca name=\"result\"\u003e\u003c/a\u003e\n### Results\n\nThe results fo compilation will be a foldr `./build` containing 2 files\n\n* `./build/shared-service.angular.js`\n\n\t```\n\tfunction SharedService(param1) {\n\t\tconsole.log('Ola', param1);\n\t}\n\n\tangular.module('SharedService', ['param1'])\n\t\t.factory('SharedService', ['param1', SharedService]);\n\t```\n\n\n\n\u003ca name=\"setMain\"\u003e\u003c/a\u003e\n## Configure properly `main` field in bower.json and package.json\n\n**bower.json**\n\n```\n\t...\n\t\"main\":\"./build/shared-service.angular.js\",\n\t...\n```\n\n\n# Roadmap\n\n* Remove generation of node.js file\n* Create a parser module with following functions:\n  * getDependenciesNames(moduleString) // extract require instructions, removing eventually user prefix\n  * other methods ...\n* Fix compilation for AngularJS: the node exported object should be in a wrapping function, depednencies should be delcared in the wrapping function, and the wrapping function should return the exported object\n* Add support for semantic versioning of bower: `shared-pack ./node-file.js patch|minor|major` changes field \"version\" in bower.json.\n* Add support for updating bower.json dependencies based on modules installed via npm\n* Add support for updating bower.json with git address for private packages \n* Add support for private npm packages\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitliner%2Fshared-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitliner%2Fshared-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitliner%2Fshared-pack/lists"}