npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-translator

v1.0.1

Published

Google Translate API for Free

Downloads

17

Readme

(google-translator) Google Translator API for FREE

Translate with google for FREE without API key

Installation

npm install google-translator

Usage

var translator = require('google-translator');

/*
Translate 'Hello'
from	:	English
to		:	French
*/

translator('en' ,'fr' ,'Hello' ,response => {
	console.log(response);
});

output :

{
    "text":"Bonjour",
    "isCorrect":true,
    "source":{
        "synonyms":[
            [
                "howdy",
                "hullo",
                "hi",
                "how-do-you-do"
            ]
        ],
        "pronunciation":[
            "heˈlō,həˈlō"
        ],
        "definitions":[
            {
                "type":"noun",
                "definitions":[
                    {
                        "definition":"an utterance of “hello”; a greeting.",
                        "example":"she was getting polite nods and hellos from people"
                    }
                ]
            },
            {
                "type":"exclamation",
                "definitions":[
                    {
                        "definition":"used as a greeting or to begin a telephone conversation.",
                        "example":"hello there, Katie!"
                    }
                ]
            },
            {
                "type":"verb",
                "definitions":[
                    {
                        "definition":"say or shout “hello”; greet someone.",
                        "example":"‘Hi Kirsten,’ he helloed , obviously calling me Kirsten on purpose."
                    }
                ]
            }
        ],
        "examples":[
            "But - hello - they're only 15, and they're only playing at being grown up.",
            "You are supposed to be able to keep up with my voice, hello !",
            "I said hello to him",
            "She must have been really stupid to have mimicked me… I mean, hello !",
            "So Bob, if you are out there, drop in and say hello !",
            "I mean - hello - this is just kind of a witty, fun movie.",
            "I mean, not that we have that all the time, coz hello !",
            "Umm… hello , the world just ended, everyone seems bizarrely unaffected, like the predicted deep freeze has already reached their brains.",
            "I have wanted to re-watch it like a DVD or something, but I couldn't because, hello !",
            "I yelled hello upstairs as I began to head up to see if I could help Mrs. Bishop out.",
            "It was a pleasant surprise when Sheila Sheridan came over to say hello .",
            "I haven't seen her in over a year, and yesterday she just strolls casually up to me and says hello !",
            "A man standing in line at the check-out counter of a grocery store was surprised when an attractive woman behind him said hello .",
            "I was stunned and I said I'm surprised anyone says hello to me ever in the mall or in the store after reading that.",
            "They sit in classrooms and cannot hear the teachers so, hello , it is no surprise that we are unable to get good outcomes from our education system.",
            "Quentin is surprised to see Maggie, and says hello .",
            "Ships' horns toot, children wave and call hello , and every morning you're awakened by the haunting call of the muezzin from some distant village mosque.",
            "Logan didn't say hello , but I hadn't expected a greeting.",
            "hello! did you even get what the play was about?",
            "We didn't get the chance to get together this visit, but we had nice phone conversation and a waved hello .",
            "But we had a surprise in store for Caroline when we said hello after the show.",
            "She whispered hello , then began to make her way to her room, where she hoped to take a nap.",
            "hello, what's this?",
            "Okay, so maybe costs rose by more than 1% in that period, and maybe sales dropped earlier in the year, but hello !",
            "My second thought is, hello , it's still snowing!",
            "It is extraordinary how much can be achieved when you put enthusiasm into a routine task, a special project or a simple hello or conversation.",
            "Like we have time for a life - hello !",
            "I thought it summed up what I wanted to say and it also is a way to say hello !",
            "Tlingit people do not use such greetings as hello , good-bye, good afternoon, or good evening.",
            "hello there, Katie!"
        ]
    },
    "target":{
        "synonyms":[
            "Bonjour!",
            "Salut!",
            "Tiens!",
            "Allô!"
        ]
    },
    "translations":[
        {
            "type":"interjection",
            "translations":[
                [
                    "Bonjour!",
                    [
                        "Hello!",
                        "Hi!",
                        "Good morning!",
                        "Good afternoon!",
                        "How do you do?",
                        "Hallo!"
                    ]
                ],
                [
                    "Salut!",
                    [
                        "Hi!",
                        "Hello!",
                        "Salute!",
                        "All the best!",
                        "Hallo!",
                        "Hullo!"
                    ]
                ],
                [
                    "Tiens!",
                    [
                        "Hallo!",
                        "Hello!",
                        "Hullo!",
                        "Why!"
                    ]
                ],
                [
                    "Allô!",
                    [
                        "Hello!",
                        "Hullo!",
                        "Hallo!"
                    ]
                ]
            ]
        }
    ]
}

Wrong sentences

var translator = require('google-translator');

translator('en' ,'fr' ,'helloe' ,response =>{		
	if(response.isCorrect==false){
		console.log('did you mean : %s ?',response.text);
	}
});

output :

Did You Mean : hello ?

List of all available languages

var translator = require('google-translator');

console.log(translator.languages);

output :

{
	af: 'Afrikaans',
	sq: 'Albanian',
	ar: 'Arabic',
	az: 'Azerbaijani',
	eu: 'Basque',
	bn: 'Bengali',
	be: 'Belarusian',
	bg: 'Bulgarian',
	ca: 'Catalan',
	'zh-cn': 'Chinese Simplified',
	'zh-tw': 'Chinese Traditional',
	hr: 'Croatian',
	cs: 'Czech',
	da: 'Danish',
	nl: 'Dutch',
	en: 'English',
	eo: 'Esperanto',
	et: 'Estonian',
	tl: 'Filipino',
	fi: 'Finnish',
	fr: 'French',
	gl: 'Galician',
	ka: 'Georgian',
	de: 'German',
	el: 'Greek',
	gu: 'Gujarati',
	ht: 'Haitian Creole',
	iw: 'Hebrew',
	hi: 'Hindi',
	hu: 'Hungarian',
	is: 'Icelandic',
	id: 'Indonesian',
	ga: 'Irish',
	it: 'Italian',
	ja: 'Japanese',
	kn: 'Kannada',
	ko: 'Korean',
	la: 'Latin',
	lv: 'Latvian',
	lt: 'Lithuanian',
	mk: 'Macedonian',
	ms: 'Malay',
	mt: 'Maltese',
	no: 'Norwegian',
	fa: 'Persian',
	pl: 'Polish',
	pt: 'Portuguese',
	ro: 'Romanian',
	ru: 'Russian',
	sr: 'Serbian',
	sk: 'Slovak',
	sl: 'Slovenian',
	es: 'Spanish',
	sw: 'Swahili',
	sv: 'Swedish',
	ta: 'Tamil',
	te: 'Telugu',
	th: 'Thai',
	tr: 'Turkish',
	uk: 'Ukrainian',
	ur: 'Urdu',
	vi: 'Vietnamese',
	cy: 'Welsh',
	yi: 'Yiddish'
}