Socket
Socket
Sign inDemoInstall

le-robert

Package Overview
Dependencies
118
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    le-robert

A library to scrape data from the French dictionary Le Robert


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

📕 Le Robert

This library gives you access to French words data by scraping them from the dictionary Le Robert, one of the most famous French dictionaries, using Puppeteer.

📥 Installation

NPM

npm install le-robert

Yarn

yarn add le-robert

PNPM

pnpm add le-robert

🔧 Functions

Each function can be imported from the library as below 👇

// Require syntax
const { getDefinitionGroups, getPronunciation, ... } = require('le-robert');

// Import syntax
import { getDefinitionGroups, getPronunciation, ... } from 'le-robert';

getDefinitionGroups(wordQuery: string): Promise<DefinitionGroup[]>

Example
await getDefinitionGroups('programmation'); // => https://sourceb.in/4rSVNnS0rQ

getPronunciation(wordQuery: string): Promise<Pronunciation>

Example
await getPronunciation('programmation'); // => https://sourceb.in/5rHNNIWFZD

getUsageExamples(wordQuery: string): Promise<UsageExample[]>

Example
await getUsageExamples('programmation'); // => https://sourceb.in/IekuY8L8Jp

getConjugationGroups(verbQuery: string): Promise<ConjugationGroup[]>

Example
await getConjugationGroups('programmer'); // => https://sourceb.in/HZccVYUGzJ

⚙️ Types

Since some of the returned objects from the previous functions may be huge, here is the types to help you understand better how to use the data.

Also, you can use the intellisense of your editor to explore the data.


DefinitionGroup

interface DefinitionGroup {
   category: string;
   definitions: Definition[];
}

Definition

interface Definition {
   value: string;
   examples: string[];
   context?: string;
}

Pronunciation

interface Pronunciation {
   audioURL: string;
}

UsageExample

interface UsageExample {
   value: string;
   source: UsageExampleSource;
}

UsageExampleSource

interface UsageExampleSource {
   value: string;
   url: string;
}

ConjugationGroup

interface ConjugationGroup {
   name: string;
   subgroups: ConjugationSubgroup[];
}

ConjugationSubgroup

interface ConjugationSubgroup {
   name: string;
   tenses: ConjugationTense[];
}

ConjugationTense

interface ConjugationTense {
   name: string;
   conjugations: string[];
}

Keywords

FAQs

Last updated on 14 Aug 2023

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