{"id":17402304,"url":"https://github.com/qfox/pym","last_synced_at":"2025-08-21T20:14:26.352Z","repository":{"id":20603867,"uuid":"23884858","full_name":"qfox/pym","owner":"qfox","description":":gift: Packaged YM-modules","archived":false,"fork":false,"pushed_at":"2016-10-03T20:20:07.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-06T10:17:53.746Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qfox.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}},"created_at":"2014-09-10T17:42:27.000Z","updated_at":"2016-09-09T05:16:19.000Z","dependencies_parsed_at":"2022-08-21T05:20:07.118Z","dependency_job_id":null,"html_url":"https://github.com/qfox/pym","commit_stats":null,"previous_names":["zxqfox/pym"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/qfox/pym","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qfox%2Fpym","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qfox%2Fpym/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qfox%2Fpym/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qfox%2Fpym/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qfox","download_url":"https://codeload.github.com/qfox/pym/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qfox%2Fpym/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263882519,"owners_count":23524501,"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-10-16T17:25:49.666Z","updated_at":"2025-07-07T14:33:40.865Z","avatar_url":"https://github.com/qfox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pym\n\n[![NPM version](https://img.shields.io/npm/v/pym.svg?style=flat)](https://www.npmjs.org/package/pym)\n[![Build Status](https://img.shields.io/travis/zxqfox/pym.svg?branch=master\u0026style=flat)](https://travis-ci.org/zxqfox/pym)\n[![Coverage Status](https://img.shields.io/coveralls/zxqfox/pym.svg?style=flat)](https://coveralls.io/r/zxqfox/pym?branch=master)\n[![Dependency Status](https://img.shields.io/david/zxqfox/pym.svg?style=flat)](https://david-dm.org/zxqfox/pym)\n[![Dev Dependency Status](https://img.shields.io/david/dev/zxqfox/pym.svg?style=flat)](https://david-dm.org/zxqfox/pym)\n\nPackaged YM-modules\n\n## What is it?\n\nIt's a CommonJS module-assistant for creating plugin-based apps.\n\nProvides API for loading packages (plugins as npm-modules).\n\nSupports asynchronous `define`, `require`, `provide` (inherited from `ym`).\n\nMade for simplifying plugin-based apps building.\n\nWhy it's not based on `CommonJS`? Because `ym` is more elegant.\n\n## API\n\nПакет предоставляет класс `App`, от которого можно наследовать класс вашего приложения; а так же статический метод `create`.\n\n### App\n\n```js\nvar pym = require('pym');\nvar util = require('util');\n\nutil.inherits(myApp, pym);\nfunction myApp(opts) {\n  pym.call(this, opts);\n  // your custom application\n}\n\nvar app = new myApp();\n```\n\n### App.create\n\n```js\nvar app = require('pym').create({ /* options */ });\n```\n\n### App.prototype.define - module definition\n\n  - {string} moduleName\n  - {string[]} [dependencies]\n  - {function(function(objectToProvide, [error]), ...[resolvedDependency], [previousDeclaration])} declarationFunction\n\nsee [ym.prototype.define](https://github.com/ymaps/modules/#module-declaration)\n\n### App.prototype.require - module usage\n\n  - {string[]} dependencies\n  - {function(...[resolvedDependency])} successCallbackFunction\n  - {function(error: Error)} [errorCallbackFunction]\n\nsee [ym.prototype.require](https://github.com/ymaps/modules/#module-usage)\n\n### App.prototype.usePackage - package loading\n\nWaits for:\n\n  - {String} package — npm-package name or path to package\n  - {Object} options — some package options\n\n```js\nvar app = require('pym').create({ /* options */ });\napp.usePackage('some-npm-package');\napp.require('module', function (module) {\n  // your app\n  module.doSomething();\n});\n```\n\n## Relation to Architect\n\n`pym` has a wrapper to load modules built with [Architect plugin interface](https://github.com/c9/architect/#plugin-interface).\nIt means you can easily use packages (plugins) made for `Architect` platform in `pym` infrastructure. `Architect` services will be resolved as `ym`-modules.\n\nDifferences from `Architect`:\n  - it hasn't `loadConfig` method — and no frozen config format, use any config you like;\n  - it supports asynchronous provide in runtime;\n  - packages interface is more explicit.\n\n## Thanks\n\n  - Built with [ymaps/modules](https://github.com/ymaps/modules)\n  - Inspired by [c9/architect](https://github.com/c9/architect)\n\n## License\n\n[MIT](http://github.com/zxqfox/pym/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqfox%2Fpym","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqfox%2Fpym","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqfox%2Fpym/lists"}