0.1.5 • Published 9 months ago

yundict v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Yundict API JavaScript client

npm Run test Downloads total

The official JavaScript / TypeScript / Node.js library for the Yundict API.

Features

  • Includes core API methods (teams, projects, keys)
  • ESM only
  • TypeScript support
  • Node.js / Bun.js / Deno / Browser support

Installation

npm install yundict

Usage

import { Yundict } from 'yundict';

const yundict = new Yundict({
  token: 'API TOKEN'
});

Options

nameTypeDescription
tokenstringAPI token
request.fetchfunctionCustom replacement for built-in fetch method

APIs

Teams

// Get all teams
yundict.teams.all()
// Get a team by name
yundict.teams.get('team-name')
// Create a team
yundict.teams.create({ name: "test-team", displayName: "Test Team" });
// Update a team
yundict.teams.update('test-team', { displayName: "Test Team 2" });
// Delete a team
yundict.teams.delete('test-team');

Projects

// Get all projects
yundict.projects.all({ teamName:"my-team" })
// Get a project by name
yundict.projects.get("my-team", 'my-proj')
// Create a project
yundict.projects.create("my-team", { displayName: "Test Project" });
// Update a project
yundict.projects.update("my-team", 'my-proj', { displayName: "Test Project 2" });
// Delete a project
yundict.projects.delete("my-team", 'my-proj')

Keys

// Get all keys
yundict.keys.all("my-team", 'my-proj')
// Create a key
yundict.keys.create("my-team", 'my-proj', "test-key");
// Update a key
yun.keys.update("my-team", 'my-proj', "test-key", { name: "new-key" });
// Delete a key
yundict.keys.delete("my-team", 'my-proj', "test-key");
// Import keys from a file
yundict.keys.import("my-team", 'my-proj', { file: ... });
// Export keys to a file
yundict.keys.export("my-team", 'my-proj', { languages: "en", type: "json" });
0.1.2

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.5

9 months ago

0.1.0

12 months ago

0.1.1-0

12 months ago

0.0.1-alpha.6

1 year ago

0.0.1-alpha.5

1 year ago

0.0.1-alpha.4

2 years ago

0.0.1-alpha.3

2 years ago

0.0.1-alpha.2

2 years ago

0.0.1-alpha.1

2 years ago