{"id":20119831,"url":"https://github.com/gruntjs/grunt-legacy-event-logger","last_synced_at":"2025-05-06T14:32:52.815Z","repository":{"id":32809120,"uuid":"36401771","full_name":"gruntjs/grunt-legacy-event-logger","owner":"gruntjs","description":"Event logger for Grunt legacy libs.","archived":false,"fork":false,"pushed_at":"2021-03-22T15:20:28.000Z","size":15,"stargazers_count":3,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-09T13:48:00.362Z","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/gruntjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-27T23:18:58.000Z","updated_at":"2023-10-11T22:53:33.000Z","dependencies_parsed_at":"2022-08-07T18:01:55.706Z","dependency_job_id":null,"html_url":"https://github.com/gruntjs/grunt-legacy-event-logger","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/gruntjs%2Fgrunt-legacy-event-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-legacy-event-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-legacy-event-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-legacy-event-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruntjs","download_url":"https://codeload.github.com/gruntjs/grunt-legacy-event-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252703465,"owners_count":21790890,"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-11-13T19:17:20.776Z","updated_at":"2025-05-06T14:32:52.484Z","avatar_url":"https://github.com/gruntjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-legacy-event-logger [![NPM version](https://badge.fury.io/js/grunt-legacy-event-logger.svg)](http://badge.fury.io/js/grunt-legacy-event-logger)\n\n\u003e Event logger for Grunt legacy libs.\n\n## Heads up!\n\nThis is not ready for use yet! We'll update the readme when it's ready to go, feel free to star the project if you want updates in the meantime!\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i grunt-legacy-event-logger --save\n```\n\n## Usage\n\n```js\nvar EventLogger = require('grunt-legacy-event-logger');\n```\n\n## API\n\n### [EventLogger](index.js#L19)\n\nCreate an instance of `EventLogger`\n\n### [.base](index.js#L39)\n\nFactory for creating logger emitters.\n\n**Params**\n\n* `name` **{String}**: the name of the log event to emit. Example: `info`\n* `message` **{String}**: Message intended to be logged to the console.\n* `returns` **{Object}** `EventLogger`: for chaining\n\n**Example**\n\n```js\nlogger.base('info', 'This is an info message');\n\n// the above is equivalent to:\nlogger.create('info');\nlogger.info('This is an info message')\n```\n\n### [.create](index.js#L57)\n\nCreate a logger method to emit an event with the given `name`.\n\n**Params**\n\n* `name` **{String}**: the name of the log event to emit\n* `returns` **{Object}** `EventLogger`: for chaining\n\n**Example**\n\n```js\nlogger.create('info');\nlogger.on('info', function(msg) {\n  //=\u003e 'this is an info event!'\n});\n\n// usage\nlogger.info('this is an info event!');\n```\n\n### [.modes](index.js#L75)\n\nAdd arbitrary modes to be used for creating namespaces for logger methods.\n\n**Params**\n\n* `modes` **{Array|String}**: Mode or array of modes to add to the logger.\n* `returns` **{Object}** `EventLogger`: for chaining\n\n**Example**\n\n```js\nlogger.modes(['verbose', 'notverbose']);\nlogger.create('info');\n\n// usage\nlogger.verbose.info('emit an info logger event while in \"verbose\" mode');\nlogger.notverbose.info('emit an info logger event while in \"notverbose\" mode');\n```\n\n### [.operator](index.js#L97)\n\nAdd an operator that will invoke the provided getter method.\n\n**Params**\n\n* `ops` **{String}**: List of operations to add to the logger.\n* `getter` **{Function}**: Getter method to invoke when the operator property is accessed.\n* `returns` **{Object}** `EventLogger`: for chaining\n\n**Example**\n\n```js\nlogger.operator('or', function () {\n  if (this.mode === 'verbose') return this.notverbose;\n  if (this.mode === 'notverbose') return this.verbose;\n  return this.always;\n});\n\n// usage\nlogger.verbose.write('verbose').or.write('notverbose');\n```\n\n## Related projects\n\n* [grunt](http://gruntjs.com/): The JavaScript Task Runner\n* [grunt-cli](http://gruntjs.com/): The grunt command line interface.\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d \u0026\u0026 npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/gruntjs/grunt-legacy-event-logger/issues/new)\n\n## Release history\n\n**DATE**       **VERSION**   **CHANGES**\n\n* 2015-05-26   v0.1.0        First commit\n\n## License\n\nCopyright © 2015 The Grunt Team\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 04, 2015._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-legacy-event-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruntjs%2Fgrunt-legacy-event-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-legacy-event-logger/lists"}