{"id":13802097,"url":"https://github.com/bigpipe/pagelet","last_synced_at":"2025-10-30T04:21:53.011Z","repository":{"id":13214939,"uuid":"15899090","full_name":"bigpipe/pagelet","owner":"bigpipe","description":"Pagelets are small re-usable standalone components","archived":false,"fork":false,"pushed_at":"2016-11-16T20:44:49.000Z","size":268,"stargazers_count":55,"open_issues_count":6,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-08-28T20:31:42.639Z","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/bigpipe.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-01-14T10:37:11.000Z","updated_at":"2024-12-13T01:19:16.000Z","dependencies_parsed_at":"2022-08-24T01:31:39.574Z","dependency_job_id":null,"html_url":"https://github.com/bigpipe/pagelet","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bigpipe/pagelet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpagelet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpagelet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpagelet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpagelet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigpipe","download_url":"https://codeload.github.com/bigpipe/pagelet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpagelet/sbom","scorecard":{"id":237678,"data":{"date":"2025-08-11","repo":{"name":"github.com/bigpipe/pagelet","commit":"0f39dfddfbeeec556cbd5cff1c2945a6bb334532"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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-17T06:03:18.999Z","repository_id":13214939,"created_at":"2025-08-17T06:03:19.000Z","updated_at":"2025-08-17T06:03:19.000Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281743507,"owners_count":26553906,"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-10-30T02:00:06.501Z","response_time":61,"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":"2024-08-04T00:01:35.767Z","updated_at":"2025-10-30T04:21:52.947Z","avatar_url":"https://github.com/bigpipe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pagelet\n\n[![Version npm][version]](http://browsenpm.org/package/pagelet)[![Build Status][build]](https://travis-ci.org/bigpipe/pagelet)[![Dependencies][david]](https://david-dm.org/bigpipe/pagelet)[![Coverage Status][cover]](https://coveralls.io/r/bigpipe/pagelet?branch=master)\n\n[version]: http://img.shields.io/npm/v/pagelet.svg?style=flat-square\n[build]: http://img.shields.io/travis/bigpipe/pagelet/master.svg?style=flat-square\n[david]: https://img.shields.io/david/bigpipe/pagelet.svg?style=flat-square\n[cover]: http://img.shields.io/coveralls/bigpipe/pagelet/master.svg?style=flat-square\n\n## Installation\n\nThere are two different ways of using Pagelet in your project. If you're already\nusing the [BigPipe] framework you don't need to install anything as this module\nis exposed using:\n\n```js\nvar Pagelet = require('bigpipe').Pagelet;\n```\n\nIf you want to build stand-alone pagelets to be used in BigPipe or just want to\nuse the Pagelet pattern in your application you need to install the module your\nself using:\n\n```\nnpm install --save pagelet\n```\n\nAnd require it in your application as:\n\n```js\nvar Pagelet = require('pagelet');\n```\n\nWhich is also the code as we assume in all the examples in our documentation.\n\n## Table of Contents\n\n**Pagelet function**\n- [Pagelet.extend](#pageletextend)\n- [Pagelet.on](#pageleton)\n- [Pagelet.traverse](#pagelettraverse)\n\n**Pagelet instance**\n- [Pagelet.name](#pageletname)\n- [Pagelet.streaming](#pageletstreaming)\n- [Pagelet.RPC](#pageletrpc)\n- [Pagelet.mode](#pageletmode)\n- [Pagelet.fragment](#pageletfragment)\n- [Pagelet.remove](#pageletremove)\n- [Pagelet.view](#pageletview)\n- [Pagelet.error](#pageleterror)\n- [Pagelet.engine](#pageletengine)\n- [Pagelet.query](#pageletquery)\n- [Pagelet.css](#pageletcss)\n- [Pagelet.js](#pageletjs)\n- [Pagelet.dependencies](#pageletdependencies)\n- [Pagelet.get()](#pageletget)\n- [Pagelet.authorize()](#pageletauthorize)\n- [Pagelet.initialize()](#pageletinitialize)\n- [Pagelet.pagelets](#pageletpagelets)\n- [Pagelet.id](#pageletid)\n- [Pagelet.substream](#pageletsubstream)\n- [Pagelet._parent](#pageletparent)\n\n### Pagelet.extend\n\nThe `.extend` method is used for creating a new Pagelet constructor. It\nsubclasses the `Pagelet` constructor just like you're used to when using\n[Backbone]. It accepts an object which will be automatically applied as part of\nthe prototype:\n\n```js\nPagelet.extend({\n  js: 'client.js',\n  css: 'sidebar.styl',\n  view: 'templ.jade',\n\n  get: function get() {\n    // do stuff when GET is called via render\n  }\n});\n```\n\n### Pagelet.on\n\nIn [BigPipe] we need to know where the Pagelet is required from so we figure out\nhow to correctly resolve the relative paths of the `css`, `js` and `view`\nproperties.\n\nSo a full constructed Pagelet instance looks like:\n\n```js\nPagelet.extend({\n  my: 'prop',\n  and: function () {}\n}).on(module);\n```\n\nThis has the added benefit of no longer needing to do `module.exports = ..` in\nyour code as the `Pagelet.on` method automatically does this for you.\n\n### Pagelet.traverse\n\nRecursively find and construct all pagelets. Uses the\n[pagelets property](#pageletpagelets) to find additional child pagelets. Usually\nthere is no need to call this manually. [BigPipe] will make sure all pagelets\nare recursively discovered. Traverse should be called with the name of the\nparent pagelet, so each child has a proper reference.\n\n```\nPagelet.extend({\n  name: 'parent name',\n  pagelets: {\n    one: require('pagelet'),\n    two: require('pagelet')\n  }\n}).traverse('parent name');\n```\n\n### Pagelet.name\n\n_required:_ **writable, string**\n\nEvery pagelet should have a name, it's one of the ways that [BigPipe] uses to\nidentify which pagelet and where it should be loaded on the page. The name\nshould be an unique but human readable string as this will be used as value for\nthe `data-pagelet=\"\"` attributes on your [Page], but this name is also when you\nwant to check if a `Pagelet` is available.\n\n```js\nPagelet.extend({\n  name: 'sidebar'\n}).on(module);\n```\n\nIf no `name` property has been set on the Pagelet it will take the `key` that\nwas used when you specified the pagelets for the [Page]:\n\n```js\nvar Page = require('bigpipe').Page;\n\nPage.extend({\n  pagelets: {\n    sidebar: '../yourpagelet.js',\n    another: require('../yourpagelet.js')\n  }\n}).on(module);\n```\n\nIf you supplied the [Page] instance if a path to a folder of pagelet folders it\nwill use the name of the folders:\n\n```js\nvar Page = require('bigpipe').Page;\n\nPage.extend({\n  pagelets: './pagelets-folder'\n}).on(module);\n```\n```\n|- page.js\n|- pagelets-folder/\n   |\n   |- foo/\n   |- bar/\n   |- baz/\n```\n\nSo in the example above you would have 3 pagelets with the names `foo`, `bar` and\n`baz`.\n\n### Pagelet.streaming\n\n_optional:_ **writable, boolean**\n\nWhen enabled we will stream the submit of each form that is within a Pagelet to\nthe server instead of using the default full page refreshes. After sending the\ndata the resulting HTML will be used to only update the contents of the pagelet.\n\nIf you want to opt-out of this with one form you can add a\n`data-pagelet-async=\"false\"` attribute to the form element.\n\n**Default value**: `false`\n\n```js\nPagelet.extend({\n  streaming: true\n});\n```\n\n### Pagelet.RPC\n\n_optional:_ **writable, array**\n\nThe `RPC` array specifies the methods that can be remotely called from the\nclient/browser. Please note that they are not actually send to the client as\nthese functions will execute on the server and transfer the result back to the\nclient.\n\nThe first argument that these functions receive is an error first style callback\nwhich is used to transfer the response back to the client. All other arguments\nwill be the arguments that were used to call the method on the client.\n\n**Default value**: `[]`\n\n ```js\nPagelet.extend({\n  RPC: [ 'methodname' ],\n\n  methodname: function methodname(reply, arg1, arg2) {\n\n  }\n}).on(module);\n```\n\n### Pagelet.mode\n\n_optional:_ **writable, string**\n\nSet the render mode the pagelet fragment. This will determine which client side\nmethod will be called to create elements. For instance, this mode can be changed\nto `svg` to generate SVG elements with the SVG namespaceURI.\n\n**Default value**: `html`\n\n```js\nPagelet.extend({\n  mode: 'svg',\n}).on(module);\n```\n\nWe currently support two different render modes:\n\n- **html**: Render HTML elements.\n- **svg**: Render SVG elements.\n\n### Pagelet.fragment\n\n_optional:_ **writable, string**\n\nA default fragment is provided via `Pagelet.fragment`, however it is\npossible to overwrite this default fragment with a custom fragment. This fragment\nis used by render to generate content with appropriate data to work with [BigPipe].\nChange `Pagelet.fragment` if you'd like to invoke render and generate custom output.\n\n**Default value**: see [pagelet.fragment][frag]\n\n```js\nPagelet.extend({\n  fragment: '\u003cdiv\u003e{pagelet:template}\u003c/div\u003e',\n}).on(module);\n```\n\nThe received fragment can contain various of placeholders which will be replaced\nbefore the template is flushed to the browser. The following placeholders are\nsupported:\n\n- `{pagelet:template}` This contains the rendered output of your specified view.\n- `{pagelet:name}` The name of pagelet we're currently rendering.\n- `{pagelet:data}` A JSON string blob of meta data about the pagelet which contains:\n  - `id`: String, A unique id of the pagelet that was rendered.\n  - `mode`: String, the render mode that you've configured.\n  - `rpc`: Array, names of the RPC methods.\n  - `remove`: Boolean, should this be removed from the DOM.\n  - `streaming`: Boolean, should we stream form submits\n  - `parent`: String, name of the parent pagelet.\n  - `hash`: Object, containing the MD5 hashes of the client view.\n\n### Pagelet.remove\n\n_optional:_ **writable, boolean**\n\nThis instructs our render engine to remove the pagelet placeholders from the DOM\nstructure if we've got no pagelets available for it. This makes it easier to\ncreate conditional layouts without having to worry about DOM elements that are\nleft behind.\n\n**Default value**: `true`\n\n```js\nPagelet.extend({\n  if: function conditional(req, next) {\n    next(false);\n  },\n  remove: false\n}).on(module);\n```\n\n### Pagelet.view\n\n_required:_ **writable, string**\n\nThe view is a reference to the template that we render inside the\n`data-pagelet=\"\u003cname\u003e\"` placeholders. Please make sure that your template can be\nrendered on both the client and server side. Take a look at our [temper] project\nfor template engines that we support.\n\n### Pagelet.error\n\n_optional:_ **writable, string**\n\nJust like the `Pagelet.view` this is a reference to a template that we will\nrender in your `data-pagelet=\"\u003cname\u003e\"` placeholders but this template is only\nrendered when:\n\n1. We receive an `Error` argument in our callback that we supply to the\n   `Pagelet#get` method.\n2. Your `Pagelet.view` throws an error when we're rendering the template.\n\nIf this property is not set we will default to a template that ships with this\nPagelet by default. This template includes a small HTML fragment that states the\nerror.\n\n### Pagelet.engine\n\n_optional:_ **writable, string**\n\nWe attempt to detect the correct template engine based on filename as well as\nthe template engine's that we can require. It is possible that we make the wrong\nassumption and you wanted to use `handlebars` for your `.mustache` based\ntemplates but it choose to use `hogan.js` instead.\n\n```js\nPagelet.extend({\n  view: 'sidebar.mustache',\n  engine: 'handlebars'\n}).on(module);\n```\n\n**Please note that the engine needs to be compatible with the [temper] module\nthat we use to compile the templates**\n\n### Pagelet.query\n\n_optional:_ **writable, array**\n\nFor optimal performance the data that is send to the client will be minimal\nand dependant on they query that is provided. Data can be supplied to the client\nby listing the keys (nested paths in dot notation) of which the data should be\nsend to the client. In the example only the content of `mydata` and `nested.is`\nwill be send.\n\n```js\nPagelet.extend({\n  query: [ 'mydata', 'nested.is' ],\n  get: function get(done) {\n    done(null, {\n      mydata: 'test',\n      nested: { is: 'allowed', left: 'alone' },\n      more: 'data'\n    });\n  }\n}).on(module);\n```\n\n### Pagelet.css\n\n_optional:_ **writable, string**\n\nThe location of the styling for **only this** pagelet. You should assume that\nyou bundle all the CSS that is required to fully render this pagelet. By\neliminating inherited CSS it will be easier for you to re-use this pagelet on\nother pages as well as in other projects.\n\n```js\nPagelet.extend({\n  css: './my-little-pony.styl'\n}).on(module);\n```\n\n**Please note that this doesn't have to be a `.css` file as we will\ntransparently pre-process these files for you. See the [smithy] project for the\ncompatible pre-processors.**\n\n### Pagelet.js\n\n_optional:_ **writable, string**\n\nAs you might have guessed, this is the location of the JavaScript that you want\nto have loaded for your pagelet. We use [fortress] to sandbox this JavaScript in\na dedicated `iframe` so the code you write is not affected and will not affect\nother pagelets on the same page. This also makes it relatively save to extend\nthe build-in primitives of JavaScript (adding new properties to Array etc).\n\nUnlike the `view` and `css` we do not pre-process the JavaScript. But this does\nnot mean you cannot use CoffeeScript or other pre-processed languages inside a\nPagelet. It just means that you have to compile your files to a proper\nJavaScript file and point to that location instead.\n\n```js\nPagelet.extend({\n  js: './library.js'\n}).on(module);\n```\n\n**Please note that the sandboxing is not there as a security feature, it was\nonly designed to prevent code from different pagelets clashing with each other**\n\n### Pagelet.dependencies\n\n_optional:_ **writable, array**\n\nAn array of dependencies that your pagelet depends on which should be loaded in\nadvance and available on the page before any CSS or JavaScript is executed. The\nfiles listed in this array can either a be CSS or JavaScript resource.\n\n```js\npagelet.extend({\n  dependencies: [\n    'https://google.com/ga.js'\n  ]\n}).on(module);\n```\n\n### Pagelet.get()\n\n_required:_ **writable, function**\n\nGet provides the data that is used for rendering the output of the Pagelet.\n\nThe `get` method receives one argument:\n\n- done: A completion callback which accepts two arguments. This callback should be\ncalled when your custom implementation has finished gathering data from all sources.\nCalling `done(error, data)` will allow the `render` method to complete its work.\nThe data provided to the callback will be used to render the actual Pagelet.\n\n```js\nPagelet.extend({\n  get: function get(done) {\n    var data = { provide: 'data-async' };\n    done(error, data);\n  },\n}).on(module);\n```\n\n### Pagelet.if()\n\n_optional:_ **writable, function**\n\nThe `if` function allows you to build conditional pagelets. These pagelets will\nonly be rendered if the supplied callback receives `true`. This can be used to\nbuild private pagelets like administrator pagelets that require special\npermissions in order to be shown seen.\n\nWhen used in [BigPipe] we take this concept even further as it's possible to set\nan array of pagelets that could be used in the placeholder. You could use to\nshow login and logout buttons, sign up or getting starting pagelets or even\nstart doing A/B testing with multiple pagelets! The possibilities are endless\nhere.\n\nThe supplied function receives 2 or 3 arguments:\n- req: The incoming HTTP requirement.\n- left: An array of pagelets that will tried if this pagelet callback resolves\n  to false. This is an optional argument, if you do no specify it your last\n  argument will be the completion callback that is listed below.\n- done: A completion callback which only accepts one argument, a boolean. If\n  this boolean has been set to `true` the pagelet is authorized on the page and\n  will be rendered as expected. When the argument evaluates as `false` (so also\n  null, undefined, 0 etc) we assume that it's disallowed and should not be\n  rendered.\n\n```js\nPagelet.extend({\n  if: function conditional(req, done) {\n    done(true); // True indicates that the request is authorized for access.\n  }\n}).on(module);\n```\n\nOr with 3 arguments:\n\n```js\nPagelet.extend({\n  if: function abtest(req, left, done) {\n    if (!left.length) return done(true);\n    done(Math.random() \u003c 0.5);\n  }\n}).on(module);\n```\n\n### Pagelet.initialize()\n\n_optional:_ **writable, function**\n\nThe pagelet has been initialised. If you have an authorization function this\nfunction will only be called **after** a successful authorization. If no\nauthorization hook is provided it should be called instantly.\n\n```js\nPagelet.extend({\n  initialize: function () {\n    this.once('event', function () {\n      doStuff();\n    });\n  }\n});\n```\n\n### Pagelet.pagelets\n\n_optional:_ **writable, string|array|object**\n\nEach pagelet can contain `n` child pagelets. Similar to using pagelets through\n[BigPipe], the pagelets property can be a string (filepath to file or directory),\narray or object containing multiple pagelets. All subsequent child pagelets will\nbe converged on one stack to allow full parallel initialization. The client will\nhandle deferred rendering of child pagelets, also see [_parent](#pageletparent).\n\n```\nPagelet.extend({\n  pagelets: {\n    one: require('pagelet'),\n    two: require('pagelet')\n  }\n});\n```\n\n### Pagelet.id\n\n**read only**\n\nThe unique id of a given pagelet instance. Please note that this is not a\npersistent id and will differ between every single initialised instance.\n\n### Pagelet.substream\n\n**read only**\n\nThe pagelet can also be initialised through [Primus] so it can be used for\nreal-time communication (and make things like [RPC](#pagelet-rpc) work). The\ncommunication is done over a [substream] which allows Primus multiplex the\nconnection between various of endpoints.\n\n### Pagelet._parent\n\n**read only**\n\nIf the current pagelet is intialized from another pagelet, it will have a `_parent`\nreference. The pagelets' parent name will be stored so that client-side\ninitialization is deferred till the parent is rendered.\n\n## License\n\nMIT\n\n[Backbone]: http://backbonejs.com\n[BigPipe]: http://bigpipe.io\n[Page]: http://bigpipe.io#page\n[temper]: http://github.com/bigpipe/temper\n[smithy]: http://github.com/observing/smithy\n[fortress]: http://github.com/bigpipe/fortress\n[frag]: https://github.com/bigpipe/pagelet/blob/master/pagelet.fragment\n[Primus]: https://github.com/primus/primus\n[substream]: https://github.com/primus/substream\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2Fpagelet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigpipe%2Fpagelet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2Fpagelet/lists"}