{"id":13396583,"url":"https://github.com/luin/npm-try","last_synced_at":"2025-08-21T18:33:32.111Z","repository":{"id":34922895,"uuid":"190574586","full_name":"luin/npm-try","owner":"luin","description":"🚆 Quickly try npm packages without writing boilerplate code.","archived":false,"fork":false,"pushed_at":"2024-05-04T17:20:44.000Z","size":161,"stargazers_count":112,"open_issues_count":33,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-04T18:28:48.042Z","etag":null,"topics":["cli","npm","package","tool","try"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/luin.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-06T12:05:38.000Z","updated_at":"2024-05-04T18:28:50.757Z","dependencies_parsed_at":"2023-10-13T01:21:56.125Z","dependency_job_id":"f281974d-b463-4c8a-9e1c-1d73fc99c90c","html_url":"https://github.com/luin/npm-try","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2Fnpm-try","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2Fnpm-try/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2Fnpm-try/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2Fnpm-try/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luin","download_url":"https://codeload.github.com/luin/npm-try/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230017527,"owners_count":18160287,"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":["cli","npm","package","tool","try"],"created_at":"2024-07-30T18:00:57.426Z","updated_at":"2024-12-20T03:10:06.986Z","avatar_url":"https://github.com/luin.png","language":"TypeScript","funding_links":[],"categories":["npm","cli"],"sub_categories":[],"readme":"# npm-try\n\n🚆 Quickly try npm packages without writing boilerplate code.\n\n[![asciicast](https://asciinema.org/a/250257.svg)](https://asciinema.org/a/250257)\n\n[![Build Status](https://travis-ci.com/luin/npm-try.svg?branch=master)](https://travis-ci.com/luin/npm-try)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![npm latest version](https://img.shields.io/npm/v/npm-try-cli/latest.svg)](https://www.npmjs.com/package/npm-try-pkg)\n\nnpm-try provides a REPL interface for you to try NPM packages without writing any boilerplate code.\n\nSimply run `npm-try [packages ..]` anywhere on the shell and npm-try will show a REPL interface which has all packages installed and assigned to variables.\n\n## Features\n\n* Super easy to use!\n* npm-try even defines variables for you\n* Top-level `await` support (requires Node.js \u003e= 10)\n\n## Install\n\n```shell\n$ npm install -g npm-try-cli\n```\n\n## Examples\n\nWanna try the `capitalize` method of lodash package?\n\n```shell\n$ npm-try lodash\n✔ const lodash = require('lodash')\n\u003e lodash.capitalize('hello world')\n'Hello world'\n```\n\nWould like to try multiple packages at the same time?\n\n```shell\n$ npm-try lodash underscore\n✔ const lodash = require('lodash')\n✔ const underscore = require('underscore')\n\u003e lodash.first([1, 2, 3])\n1\n\u003e underscore.first([1, 2, 3])\n1\n```\n\nA previous version? You can specify versions with `@` symbol (Missing the old days when the `pluck` still exists).:\n\n```shell\n$ npm-try lodash@3\n✔ const lodash = require('lodash')\n\u003e lodash.pluck\n[Function: pluck]\n```\n\nAsynchronous operations? `await` is supported out-of-the-box. Let's try ioredis:\n\n```shell\n$ npm-try ioredis\n✔ const Redis = require('ioredis')\n\u003e const redis = new Redis()\nundefined\n\u003e await redis.get('foo')\n'123'\n```\n\n## Create a Project\nREPL is not enough sometimes when you want to write more code to test with packages. npm-try offers `--out-dir`/`-o` option to create a self-contained project so you can write your test code at the drop of a hat.\n\n```shell\n$ npm-try lodash -o try-lodash\n✔ Installing lodash...\n✔ The project created at /Users/luin/try-lodash\n```\n\n## Limitations\n\nTesting multiple versions of the same package is not supported. The following command will only have lodash@3 provided:\n\n```shell\n$ npm-try lodash@4 lodash@3\n✔ const lodash = require('lodash')\n✔ const lodash = require('lodash')\n\u003e lodash.VERSION\n'3.10.1'\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluin%2Fnpm-try","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluin%2Fnpm-try","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluin%2Fnpm-try/lists"}