{"id":13447494,"url":"https://github.com/electerious/nice-try","last_synced_at":"2025-04-04T20:09:40.728Z","repository":{"id":10120886,"uuid":"64548891","full_name":"electerious/nice-try","owner":"electerious","description":"Tries to execute a function and discards any error that occurs.","archived":false,"fork":false,"pushed_at":"2022-10-01T13:59:13.000Z","size":38,"stargazers_count":67,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T19:06:55.722Z","etag":null,"topics":["catch","error","try","try-catch"],"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/electerious.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-07-30T14:49:17.000Z","updated_at":"2025-03-10T16:25:25.000Z","dependencies_parsed_at":"2022-09-09T06:01:44.631Z","dependency_job_id":null,"html_url":"https://github.com/electerious/nice-try","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fnice-try","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fnice-try/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fnice-try/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fnice-try/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electerious","download_url":"https://codeload.github.com/electerious/nice-try/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"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":["catch","error","try","try-catch"],"created_at":"2024-07-31T05:01:19.301Z","updated_at":"2025-04-04T20:09:40.712Z","avatar_url":"https://github.com/electerious.png","language":"JavaScript","readme":"# nice-try\n\n![Build](https://github.com/electerious/nice-try/workflows/Build/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/electerious/nice-try/badge.svg?branch=master)](https://coveralls.io/github/electerious/nice-try?branch=master)\n\nA function that tries to execute a function and discards any error that occurs.\n\n## Install\n\n```\nnpm install nice-try\n```\n\n## Usage\n\n```js\nconst niceTry = require('nice-try')\n\nniceTry(() =\u003e JSON.parse('true')) // true\nniceTry(() =\u003e JSON.parse('truee')) // undefined\nniceTry() // undefined\nniceTry(true) // undefined\n\nawait niceTry.promise(async () =\u003e JSON.parse('true')) // true\nawait niceTry.promise(async () =\u003e JSON.parse('truee')) // undefined\n```\n\n## API\n\n### Parameters\n\n- `fn` `{Function}` Function that might or might not throw an error.\n\n### Returns\n\n- `{?*}` Return-value of the function when no error occurred.\n\n## What others say\n\nThis module is a controversial thing and people like to get mad about it. I decided to give those people a voice. Here's what they're saying.\n\n\u003e fundamentally inane\n\n— frou_dh\n\n\u003e the worst Javascript library […] in several categories\n\n— kuzux\n\n\u003e how is this a thing\n\n— uint8_t\n\n\u003e This is blowing my mind\n\n— mr_jim_lahey\n\n\u003e a shit-tastic try-catch alias\n\n— Dropping_fruits\n\n\u003e I assumed every commit was a joke, but after researching the maintainer a bit I'm not sure it is...\n\n— MrPineappleHat","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felecterious%2Fnice-try","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felecterious%2Fnice-try","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felecterious%2Fnice-try/lists"}