{"id":13801062,"url":"https://github.com/watson-developer-cloud/tone-analyzer-nodejs","last_synced_at":"2025-05-13T11:30:50.507Z","repository":{"id":35023063,"uuid":"39128538","full_name":"watson-developer-cloud/tone-analyzer-nodejs","owner":"watson-developer-cloud","description":"Sample Node.js Application for the IBM Tone Analyzer Service","archived":true,"fork":false,"pushed_at":"2022-06-23T18:51:53.000Z","size":3165,"stargazers_count":453,"open_issues_count":18,"forks_count":274,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-04-28T06:49:20.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tone-analyzer-demo.ng.bluemix.net/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Infogosoft/jsdicom","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/watson-developer-cloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-15T09:36:11.000Z","updated_at":"2025-04-18T04:09:27.000Z","dependencies_parsed_at":"2022-08-17T21:50:58.344Z","dependency_job_id":null,"html_url":"https://github.com/watson-developer-cloud/tone-analyzer-nodejs","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Ftone-analyzer-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Ftone-analyzer-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Ftone-analyzer-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Ftone-analyzer-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watson-developer-cloud","download_url":"https://codeload.github.com/watson-developer-cloud/tone-analyzer-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932764,"owners_count":21986445,"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":[],"created_at":"2024-08-04T00:01:19.136Z","updated_at":"2025-05-13T11:30:49.148Z","avatar_url":"https://github.com/watson-developer-cloud.png","language":"CSS","readme":"\u003ch1 align=\"center\" style=\"border-bottom: none;\"\u003e🚀 Tone Analyzer Sample Application\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eThis Node.js app demonstrates some of the Tone Analyzer service features.\n\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://travis-ci.org/watson-developer-cloud/tone-analyzer-nodejs\"\u003e\n    \u003cimg alt=\"Travis\" src=\"https://travis-ci.org/watson-developer-cloud/tone-analyzer-nodejs.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#badge\"\u003e\n    \u003cimg alt=\"semantic-release\" src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c/p\u003e\n\nThe IBM Watson [Tone Analyzer][docs] service is a cognitive linguistic analysis service that detects 7 tones which are most commonly used to detect the tone of written text. These are: anger, fear, joy, sadness, confident, analytical, and tentative.\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/watson-developer-cloud/tone-analyzer-nodejs.svg)](https://greenkeeper.io/)\n\n## Prerequisites\n\n1. Sign up for an [IBM Cloud account](https://cloud.ibm.com/registration/).\n1. Download the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli/index.html#overview).\n1. Create an instance of the Tone Analyzer service and get your credentials:\n    - Go to the [Tone Analyzer](https://cloud.ibm.com/catalog/services/tone-analyzer) page in the IBM Cloud Catalog.\n    - Log in to your IBM Cloud account.\n    - Click **Create**.\n    - Click **Show** to view the service credentials.\n    - Copy the `apikey` value, or copy the `username` and `password` values if your service instance doesn't provide an `apikey`.\n    - Copy the `url` value.\n\n## Configuring the application\n\n1. In the application folder, copy the *.env.example* file and create a file called *.env*\n\n    ```\n    cp .env.example .env\n    ```\n\n2. Open the *.env* file and add the service credentials that you obtained in the previous step.\n\n    Example *.env* file that configures the `apikey` and `url` for a Tone Analyzer service instance hosted in the US East region:\n\n    ```\n    TONE_ANALYZER_IAM_APIKEY=X4rbi8vwZmKpXfowaS3GAsA7vdy17Qh7km5D6EzKLHL2\n    TONE_ANALYZER_URL=https://gateway-wdc.watsonplatform.net/tone-analyzer/api\n    ```\n\n    - If your service instance uses `username` and `password` credentials, add the `TONE_ANALYZER_USERNAME` and `TONE_ANALYZER_PASSWORD` variables to the *.env* file.\n\n    Example *.env* file that configures the `username`, `password`, and `url` for a Tone Analyzer service instance hosted in the Sydney region:\n\n    ```\n    TONE_ANALYZER_USERNAME=522be-7b41-ab44-dec3-g1eab2ha73c6\n    TONE_ANALYZER_PASSWORD=A4Z5BdGENrwu8\n    TONE_ANALYZER_URL=https://gateway-syd.watsonplatform.net/tone-analyzer/api\n    ```\n## Running locally\n\n1. Install the dependencies\n\n    ```\n    npm install\n    ```\n\n1. Run the application\n\n    ```\n    npm start\n    ```\n\n1. View the application in a browser at `localhost:3000`\n\n## Deploying to IBM Cloud as a Cloud Foundry Application\n\n1. Login to IBM Cloud with the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli/index.html#overview)\n\n    ```\n    ibmcloud login\n    ```\n\n1. Target a Cloud Foundry organization and space.\n\n    ```\n    ibmcloud target --cf\n    ```\n\n1. Edit the *manifest.yml* file. Change the **name** field to something unique.  \n  For example, `- name: my-app-name`.\n\n1. Deploy the application\n\n    ```\n    ibmcloud app push\n    ```\n\n1. View the application online at the app URL. For example: https://my-app-name.mybluemix.net\n\n## Deploying to IBM Cloud as a Kubernetes Application\n\n1. Login to IBM Cloud with the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli/index.html#overview)\n\n    ```\n    ibmcloud login\n    ```\n1. Install the Kubernetes CLI and configure it to run [`kubectl`](https://console.bluemix.net/docs/containers/cs_cli_install.html#cs_cli_configure) commands.\n\n\n1. Edit the `kube-deploy.yaml` file and update the environment variables in the container with the service credentials\n\n1. Deploy the application\n    ```bash\n    kubectl apply -f kube-deploy.yaml\n    ```\n    Expected output:\n    ```none\n    service/tone-analyzer-nodejs created\n    deployment.apps/tone-analyzer-nodejs created\n    ingress.extensions/tone-analyzer-nodejs created\n    ```\n\n![](https://www.reactiongifs.com/wp-content/uploads/2012/08/well_done_sir.gif)\n## License\n\nThis sample code is licensed under Apache 2.0.  \nFull license text is available in [LICENSE](LICENSE).\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n## Open Source @ IBM\n\nFind more open source projects on the\n[IBM Github Page](http://ibm.github.io/).\n\n[service_url]: https://www.ibm.com/watson/services/tone-analyzer/\n[docs]: https://cloud.ibm.com/docs/services/tone-analyzer/index.html#about\n","funding_links":[],"categories":["CSS","Data \u0026 AI"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson-developer-cloud%2Ftone-analyzer-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatson-developer-cloud%2Ftone-analyzer-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson-developer-cloud%2Ftone-analyzer-nodejs/lists"}