Socket
Socket
Sign inDemoInstall

longdo-api

Package Overview
Dependencies
16
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    longdo-api

an unofficial api for Longdo dictionary which return queries as json


Version published
Weekly downloads
6
Maintainers
1
Install size
2.90 MB
Created
Weekly downloads
 

Readme

Source

longdo-api

A simple unofficial Node.js API for straightforward interfacing with Longdo's dictionary API.

Installation

Using NPM:

$ npm install longdo-api

Using Yarn:

$ yarn add longdo-api

Usage

async search(query, cleanup=true)

Queries the Longdo API and returns the result (see format below)

Parameters:

  • query: query to search (string)
  • cleanup: whether to clean up data (string trim, etc.)

Returns: Promise<Record<string, string[][]>>

Example code

const longdo = require('longdo-api');

longdo.search('fandango').then((result) => {
    console.log(result);
});

Response example

{
    "NECTEC Lexitron Dictionary EN-TH": [
        ["fandango", "[N] การเต้นระบำสเปนแบบสามจังหวะ, See also: ดนตรีสามจังหวะสำหรับเต้นระบำสเปน"]
    ],
    "ตัวอย่างประโยคจาก Open Subtitles ** ระวัง คำแปลอาจมีข้อผิดพลาด **": [
        ["# Scaramouch, scaramouch Will you do the fandango #", "# เจ้าคนชั่ว, เจ้าคนชั่ว เจ้าเต้นรำได้มั้ย?"],
        [
            "We must do something before they fandango themselves into oblivion!",
            "เราต้องทำอะไรซักอย่าง ก่อนที่พวกเขาจะเต้นจนหายเข้าไปในป่า"
        ],
        ["- Hey. - Christ Fandango!", "เฮ้ คริสตร์ แฟนเดโก"]
    ],
    "CMU Pronouncing Dictionary": [["FANDANGO", "F AE0 N D AE1 NG G OW2"]],
    "Oxford Advanced Learners Dictionary": [
        ["fandango", "(n) fˌændˈæŋgou"],
        ["fandangos", "(n) fˌændˈæŋgouz"]
    ],
    "EDICT JP-EN Dictionary": [["ファンダンゴ", "[, fandango] (n) fandango (spa"]]
}

License

MIT

Keywords

FAQs

Last updated on 28 Jan 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc