{"id":31052684,"url":"https://github.com/getconversio/asset-helper","last_synced_at":"2025-09-15T01:05:13.215Z","repository":{"id":26885554,"uuid":"30346382","full_name":"getconversio/asset-helper","owner":"getconversio","description":"NodeJs Asset Helper","archived":false,"fork":false,"pushed_at":"2016-11-02T16:50:12.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-08-27T09:51:45.896Z","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/getconversio.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":"2015-02-05T08:55:42.000Z","updated_at":"2016-03-02T09:30:02.000Z","dependencies_parsed_at":"2022-08-31T08:20:06.713Z","dependency_job_id":null,"html_url":"https://github.com/getconversio/asset-helper","commit_stats":null,"previous_names":["receiptful/asset-helper"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/getconversio/asset-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getconversio%2Fasset-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getconversio%2Fasset-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getconversio%2Fasset-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getconversio%2Fasset-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getconversio","download_url":"https://codeload.github.com/getconversio/asset-helper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getconversio%2Fasset-helper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275189861,"owners_count":25420662,"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-14T02:00:10.474Z","response_time":75,"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-09-15T01:05:10.405Z","updated_at":"2025-09-15T01:05:13.187Z","avatar_url":"https://github.com/getconversio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Asset Helper\n\n[![Build Status](https://travis-ci.org/Receiptful/asset-helper.svg?branch=master)](https://travis-ci.org/Receiptful/asset-helper)\n\nA simple and easy to use module to manage asset path and versions.\n\n## Installation\n\nInstall the module through NPM:\n\n    $ npm install asset-helper --save\n\n**Requires Node 4 or above**\n\n## Examples\n\nInclude the module and create a new `AssetHelper` object:\n\n```javascript\nconst AssetHelper = require('asset-helper');\n\n// Will output style/main.css\nconst assetHelper = new AssetHelper();\nconsole.log(assetHelper.path('style/main.css')); \n\n// Will output http://www.foo.com/style/main.css\nconst assetHelperWithBaseUrl = new AssetHelper({\n  baseUrl: 'http://www.foo.com/'\n});\nconsole.log(assetHelperWithBaseUrl.path('style/main.css')); \n\n// Will output /style/main.css?v=3094302hdhsd9fu9023\nconst assetHelperWithHash = new AssetHelper({\n  baseDirectory: __dirname + '/../public/',\n  appendHash: true\n});\nconsole.log(assetHelperWithHash.path('style/main.css'));\n\n// You can override configuration params on individual calls:\n// Will output /style/main.css\nconsole.log(assetHelperWithHash.path('style/main.css', { appendHash: false }));\n```\n\n## Configuration options\n\n### baseUrl\n\nIt will prepend a base url to your asset. Useful in case you use a CDN and want the local path when on development environment.\n\n### baseDirectory\n\nNeeded for calculating the hash, it should point to your asset main directory.\n\n### appendHash\n\nIt will append a querystring with a MD5 calculated on file content.\n\n## Testing\n\n    $ npm test\n\n## Contributing\n\nThis module was originally written to be used with Receiptful and is used in a production environment currently. This will ensure that this module is well maintained, bug free and as up to date as possible.\n\nReceiptful's developers will continue to make updates as often as required to have a consistently bug free platform, but we are happy to review any feature requests or issues and are accepting constructive pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetconversio%2Fasset-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetconversio%2Fasset-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetconversio%2Fasset-helper/lists"}