{"id":15046130,"url":"https://github.com/outatime/applause","last_synced_at":"2025-09-02T15:13:21.802Z","repository":{"id":15262958,"uuid":"17992090","full_name":"outaTiME/applause","owner":"outaTiME","description":"Human-friendly replacements.","archived":false,"fork":false,"pushed_at":"2021-05-04T00:09:47.000Z","size":113,"stargazers_count":32,"open_issues_count":3,"forks_count":23,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-20T08:43:19.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://outatime.github.io/applause.io","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/outaTiME.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-03-21T19:42:40.000Z","updated_at":"2025-02-20T23:15:32.000Z","dependencies_parsed_at":"2022-09-11T09:41:14.608Z","dependency_job_id":null,"html_url":"https://github.com/outaTiME/applause","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/outaTiME/applause","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outaTiME%2Fapplause","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outaTiME%2Fapplause/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outaTiME%2Fapplause/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outaTiME%2Fapplause/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outaTiME","download_url":"https://codeload.github.com/outaTiME/applause/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outaTiME%2Fapplause/sbom","scorecard":{"id":714803,"data":{"date":"2025-08-11","repo":{"name":"github.com/outaTiME/applause","commit":"c72b32a492a9da3996e318de6763a3f43291c85d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"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":"Code-Review","score":0,"reason":"Found 2/28 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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/outaTiME/applause/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/outaTiME/applause/main.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:22","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"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":"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: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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T09:16:09.449Z","repository_id":15262958,"created_at":"2025-08-22T09:16:09.449Z","updated_at":"2025-08-22T09:16:09.449Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273302222,"owners_count":25081180,"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-09-02T02:00:09.530Z","response_time":77,"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-09-24T20:52:45.021Z","updated_at":"2025-09-02T15:13:21.744Z","avatar_url":"https://github.com/outaTiME.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Applause 👏\n\n[![Build Status](https://img.shields.io/github/workflow/status/outaTiME/applause/CI)](https://github.com/outaTiME/applause/actions/workflows/main.yml)\n[![Version](https://img.shields.io/npm/v/applause.svg)](https://www.npmjs.com/package/applause)\n![Prerequisite](https://img.shields.io/badge/node-%3E%3D10-blue.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](#)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Twitter: outa7iME](https://img.shields.io/twitter/follow/outa7iME.svg?style=social)](https://twitter.com/outa7iME)\n\n\u003e Pattern replacer that helps to create human-friendly replacements.\n\n**Try the [playground], where you can test every single option of applause.**\n\n## Install\n\nFirst make sure you have installed the latest version of [node.js](http://nodejs.org/)\n(You may need to restart your computer after this step).\n\nFrom NPM for programmatic use:\n\n```shell\nnpm install applause\n```\n\nFrom Git:\n\n```shell\ngit clone git://github.com/outaTiME/applause\ncd applause\nnpm link .\n```\n\n## Usage\n\nAssuming installation via NPM, you can use `applause` in your application like this:\n\n```javascript\nvar fs = require('fs');\nvar Applause = require('applause');\n\nvar options = {\n  patterns: [\n    {\n      match: 'foo',\n      replacement: 'bar'\n    }\n  ]\n};\nvar applause = Applause.create(options);\nvar contents = '@@foo';\nvar result = applause.replace(contents);\nconsole.log(result.content); // bar\n```\n\n## Options\n\n### patterns\nType: `Array`\n\nDefines the patterns that will be used to replace the content input.\n\n### patterns.match\nType: `String|RegExp`\n\nIndicates the matching expression.\n\nIf the match type is `String`, a simple variable search mechanism `@@string` is used (in any other case the default regexp replacement logic is used):\n\n```javascript\n{\n  patterns: [\n    {\n      match: 'foo',\n      replacement: 'bar' // Replaces \"@@foo\" with \"bar\"\n    }\n  ]\n}\n```\n\n### patterns.replacement or patterns.replace\nType: `String|Function|Object`\n\nIndicates the replacement for match. For more information about replacement, see [String.replace].\n\nYou can specify a function as a replacement. In this case, the function will be invoked after the match has been made. The result of the function (return value) will be used as the replacement string.\n\n```javascript\n{\n  patterns: [\n    {\n      match: /foo/g,\n      replacement: function () {\n        return 'bar'; // Replaces \"foo\" with \"bar\"\n      }\n    }\n  ]\n}\n```\n\nObjects are also supported as replacement (a string representation of the object is created using [JSON.stringify]):\n\n```javascript\n{\n  patterns: [\n    {\n      match: /foo/g,\n      replacement: [1, 2, 3] // Replaces \"foo\" with string representation of the array\n    }\n  ]\n}\n```\n\n\u003e The replacement only resolves the [special replacement patterns] when using regexp to match.\n\n### patterns.json\nType: `Object`\n\nIf a `json` attribute is found in the pattern definition, the object is flattened using the [delimiter](#delimiter) concatenation and each key-value pair will be used for replacement (simple variable lookup mechanism and no regexp support).\n\n```javascript\n{\n  patterns: [\n    {\n      json: {\n        key: 'value' // Replaces \"@@key\" with \"value\"\n      }\n    }\n  ]\n}\n```\n\nNested objects are also supported:\n\n```javascript\n{\n  patterns: [\n    {\n      json: {\n        key: 'value',  // Replaces \"@@key\" with \"value\"\n        inner: {       // Replaces \"@@inner\" with string representation of the \"inner\" object\n          key: 'value' // Replaces \"@@inner.key\" with \"value\"\n        }\n      }\n    }\n  ]\n}\n```\n\nYou can define functions for deferred invocations:\n\n```javascript\n{\n  patterns: [\n    {\n      json: function (done) {\n        done({\n          key: 'value'\n        });\n      }\n    }\n  ]\n}\n```\n\n### patterns.yaml\nType: `String`\n\nIf a `yaml` attribute is found in the pattern definition, it will be converted and then processed as [json](#patternsjson) attribute.\n\n```javascript\n{\n  patterns: [\n    {\n      yaml: 'key: \"value\"' // Replaces \"@@key\" with \"value\"\n    }\n  ]\n}\n```\n\nYou can define functions for deferred invocations:\n\n```javascript\n{\n  patterns: [\n    {\n      yaml: function (done) {\n        done('key: \"value\"');\n      }\n    }\n  ]\n}\n```\n\n### patterns.cson\nType: `String`\n\nIf a `cson` attribute is found in the pattern definition, it will be converted and then processed as [json](#patternsjson) attribute.\n\n```javascript\n{\n  patterns: [\n    {\n      cson: 'key: \"value\"'\n    }\n  ]\n}\n```\n\nYou can define functions for deferred invocations:\n\n```javascript\n{\n  patterns: [\n    {\n      cson: function (done) {\n        done('key: \"value\"');\n      }\n    }\n  ]\n}\n```\n\n### variables\nType: `Object`\n\nThis is the old way of defining patterns using a simple plain object (simple variable lookup mechanism and no regexp support). You can still use this, but for more control you should use the new way of `patterns`.\n\n```javascript\n{\n  variables: {\n    'key': 'value' // Replaces \"@@key\" with \"value\"\n  }\n}\n```\n\n### prefix\nType: `String`\nDefault: `@@`\n\nThe prefix used for matching (avoid wrong replacements / easy way).\n\n\u003e This only applies for simple variable lookup mechanism.\n\n### usePrefix\nType: `Boolean`\nDefault: `true`\n\nIf set to \"false\", the pattern is matched without the \"prefix\" concatenation (this is useful when you want to lookup a simple string).\n\n\u003e This only applies for simple variable lookup mechanism.\n\n### preservePrefix\nType: `Boolean`\nDefault: `false`\n\nIf set to \"true\", the \"prefix\" is preserved in the target.\n\n\u003e This only applies for simple variable lookup mechanism and when `patterns.replacement` is a string.\n\n### delimiter\nType: `String`\nDefault: `.`\n\nThe delimiter used to flatten when using an object as a replacement.\n\n### preserveOrder\nType: `Boolean`\nDefault: `false`\n\nIf set to \"true\", we preserve the order of definition of the patterns; otherwise the order will be ascending to avoid replacement problems such as \"head\" / \"header\" (regexp matches will be resolved at last).\n\n[playground]: http://outatime.github.io/applause.io/\n[String.replace]: http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace\n[JSON.stringify]: http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\n[special replacement patterns]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter\n\n## Examples\n\n### Basic\n\nFile `src/manifest.appcache`:\n\n```\nCACHE MANIFEST\n# @@timestamp\n\nCACHE:\n\nfavicon.ico\nindex.html\n\nNETWORK:\n*\n```\n\nNode:\n\n```javascript\nvar fs = require('fs');\nvar Applause = require('applause');\n\nvar options = {\n  patterns: [\n    {\n      match: 'timestamp',\n      replacement: Date.now()\n    }\n  ]\n};\nvar applause = Applause.create(options);\nvar contents = fs.readFileSync('./src/manifest.appcache', 'utf8');\nvar result = applause.replace(contents);\nconsole.log(result.content); // The replaced output\n```\n\n### Multiple matching\n\nFile `src/manifest.appcache`:\n\n```\nCACHE MANIFEST\n# @@timestamp\n\nCACHE:\n\nfavicon.ico\nindex.html\n\nNETWORK:\n*\n```\n\nFile `src/humans.txt`:\n\n```\n              __     _\n   _    _/__  /./|,//_`\n  /_//_// /_|///  //_, outaTiME v.@@version\n\n/* TEAM */\n  Web Developer / Graphic Designer: Ariel Oscar Falduto\n  Site: https://www.outa.im\n  Twitter: @outa7iME\n  Contact: afalduto at gmail dot com\n  From: Buenos Aires, Argentina\n\n/* SITE */\n  Last update: @@timestamp\n  Standards: HTML5, CSS3, robotstxt.org, humanstxt.org\n  Components: H5BP, Modernizr, jQuery, Bootstrap, LESS, Jade, Grunt\n  Software: Sublime Text, Photoshop, LiveReload\n```\n\nNode:\n\n```javascript\nvar fs = require('fs');\nvar pkg = require('./package.json');\nvar Applause = require('applause');\n\nvar options = {\n  patterns: [\n    {\n      match: 'version',\n      replacement: pkg.version\n    },\n    {\n      match: 'timestamp',\n      replacement: Date.now()\n    }\n  ]\n};\nvar applause = Applause.create(options);\nvar contents = fs.readFileSync('./src/manifest.appcache', 'utf8');\nvar result = applause.replace(contents);\nconsole.log(result.content); // The replaced output\ncontents = fs.readFileSync('./src/humans.txt', 'utf8');\nresult = applause.replace(contents);\nconsole.log(result.content); // The replaced output\n```\n\n### Cache busting\n\nFile `src/index.html`:\n\n```html\n\u003chead\u003e\n  \u003clink rel=\"stylesheet\" href=\"/css/style.css?rel=@@timestamp\"\u003e\n  \u003cscript src=\"/js/app.js?rel=@@timestamp\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\n\nNode:\n\n```javascript\nvar fs = require('fs');\nvar Applause = require('applause');\n\nvar options = {\n  patterns: [\n    {\n      match: 'timestamp',\n      replacement: Date.now()\n    }\n  ]\n};\nvar applause = Applause.create(options);\nvar contents = fs.readFileSync('./src/index.html', 'utf8');\nvar result = applause.replace(contents);\nconsole.log(result.content); // The replaced output\n```\n\n### Include file\n\nFile `src/index.html`:\n\n```html\n\u003cbody\u003e\n  @@include\n\u003c/body\u003e\n```\n\nNode:\n\n```javascript\nvar fs = require('fs');\nvar Applause = require('applause');\n\nvar options = {\n  patterns: [\n    {\n      match: 'include',\n      replacement: fs.readFileSync('./includes/content.html', 'utf8')\n    }\n  ]\n};\nvar applause = Applause.create(options);\nvar contents = fs.readFileSync('./src/index.html', 'utf8');\nvar result = applause.replace(contents);\nconsole.log(result.content); // The replaced output\n```\n\n### Regular expression\n\nFile `src/username.txt`:\n\n```\nJohn Smith\n```\n\nNode:\n\n```javascript\nvar fs = require('fs');\nvar Applause = require('applause');\n\nvar options = {\n  patterns: [\n    {\n      match: /(\\w+)\\s(\\w+)/,\n      replacement: '$2, $1' // Replaces \"John Smith\" with \"Smith, John\"\n    }\n  ]\n};\nvar applause = Applause.create(options);\nvar contents = fs.readFileSync('./username.txt', 'utf8');\nvar result = applause.replace(contents);\nconsole.log(result.content); // The replaced output\n```\n\n### Lookup for `foo` instead of `@@foo`\n\nNode:\n\n```javascript\nvar Applause = require('applause');\n\nvar options = [\n  {\n    patterns: [\n      {\n        match: /foo/g, // Explicitly using a regexp\n        replacement: 'bar'\n      }\n    ]\n  },\n  {\n    patterns: [\n      {\n        match: 'foo',\n        replacement: 'bar'\n      }\n    ],\n    prefix: '' // Removing the prefix manually\n  },\n  {\n    patterns: [\n      {\n        match: 'foo',\n        replacement: 'bar'\n      }\n    ],\n    usePrefix: false // Using the option provided\n  }\n];\noptions.forEach(function (option) {\n  var applause = Applause.create(option);\n  var contents = 'foo';\n  var result = applause.replace(contents);\n  console.log(result.content); // bar\n});\n```\n\n## Related\n\n- [js-yaml](https://github.com/nodeca/js-yaml) - YAML 1.2 parser and serialize\n- [cson-parser](https://github.com/groupon/cson-parser) - Safe parsing of CSON files\n\n## License\n\nMIT © [outaTiME](https://outa.im)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutatime%2Fapplause","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutatime%2Fapplause","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutatime%2Fapplause/lists"}