{"id":24559243,"url":"https://github.com/parcellab/parcellab-utilities","last_synced_at":"2025-03-16T19:41:45.419Z","repository":{"id":45891626,"uuid":"165084747","full_name":"parcelLab/parcellab-utilities","owner":"parcelLab","description":"npm package for shared functionality","archived":false,"fork":false,"pushed_at":"2025-03-10T12:47:29.000Z","size":604,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-10T13:39:55.002Z","etag":null,"topics":["team-architecture"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parcelLab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-10T15:33:59.000Z","updated_at":"2025-02-21T12:14:09.000Z","dependencies_parsed_at":"2024-08-01T10:27:18.507Z","dependency_job_id":"70adc890-bc02-4b23-b106-e293ab289b0e","html_url":"https://github.com/parcelLab/parcellab-utilities","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fparcellab-utilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fparcellab-utilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fparcellab-utilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fparcellab-utilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parcelLab","download_url":"https://codeload.github.com/parcelLab/parcellab-utilities/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243922336,"owners_count":20369382,"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":["team-architecture"],"created_at":"2025-01-23T06:16:01.530Z","updated_at":"2025-03-16T19:41:45.412Z","avatar_url":"https://github.com/parcelLab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parcelLab Utilities \nnpm package for shared functionality\n\n**install:** `npm install @parcellab/utilities`\n\n## logger\n\n### import\n```javascript\nconst logToConsole = require('parcellab-utilities').logToConsole\nconst logger = require('parcellab-utilities').Logger.for('yourScriptName')\n```\n*or*\n```javascript\nimport { logToConsole, Logger } from 'parcellab-utilities'\nconst logger = Logger.for('yourScriptName') \n```\n### config\nwith environment variables and/or with manipulating the Logger object in js\n```\nLOG_LEVEL=DEBUG               ||    Logger.settings.level = 'debug' \nLOG_HOST=127.128.129.130      ||    Logger.settings.host = '127.128.129.130'\nLOG_PORT=12345                ||    Logger.settings.port = '12345'\nLOG_COLOR=1                   ||    Logger.settings.color = true\nLOG_LOCAL=1                   ||    Logger.settings.saveLocal = true\nLOG_EXTRA=1                   ||    Logger.settings.verboseLocal = true\nLOG_PRETTY=1                  ||    Logger.settings.prettyPrint = true\nLOG_TIMESTAMP=1               ||    Logger.settings.timestampLocal = true\nPRODUCTION=0                  ||    Logger.settings.developer_mode = true\n\n```\n_**⚠️** Logger is a **singleton** so change to the settings can affect logging of other modules._\n\n_**⚠️** Beware of hirarchy:_\n * javascript settings overrule env var settings.\n * env vars set in shell will overrule vars in `.env` file parsed by npm module `dotenv`\n\n\n### use\n```javascript\n// syntax: logger.level(message, [ extra, [ sender]])\nlogger.trace('\u003e\u003e', { data: [1,0,1,1,0], msgLong: 'a bit has shifted!' })\nlogger.debug('invoking some procedure', obj )\nlogger.info('this message is really informative')\nlogger.warn('something is smoking', null, 'smokeAlertSender') // custom sender\nlogger.error('grab your towels and panic: ', err)\nlogger.critical('hello slack! you should really do something about this NOW', err, 'importantFkt')\n```\n*or*\n```javascript\nlogToConsole(level, sender, message, extra)\n```\n\n## geo\n\n### import\n```javascript\nconst resolveCountryToISO3 = require('parcellab-utilities').resolveCountryToISO3\n```\n*or*\n```javascript\nimport { resolveCountryToISO3 } from 'parcellab-utilities'\n```\n\n### use\n`resolveCountryToISO3('Spain')` `// returns 'ESP'`\n\nit takes strings or anything, don't expect miracles. The underlying lib `countryjs` recognizes some translations - English or German country names should be a pretty safe bet\n\n# Making changes to this package\n❗️Never edit the files in `/lib`! They are generated from `/src`.\n\nMake use of `npm test` to see if things still pretend to be alright.\n\nWhen you have commited changes to the repository here is what needs to be done to make an updated package available (it's easy to forget at least one step:)\n1. `npm run build`\n2. `git commit -a -m 'generated new build'`\n3. `npm version patch` or `npm version minor` or `npm version major`\n4. `git push --follow-tags`\n\nor you can simply run `npm run publish` which does these things\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Fparcellab-utilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparcellab%2Fparcellab-utilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Fparcellab-utilities/lists"}