Giter Club home page Giter Club logo

retro-langs's Introduction

DofusRetro-Langs

Allows you to watch and download langs files for Dofus Retro.

Is available through a CLI and Class usable in your own code

(Thanks @drag0une for his work)

Table of contents

Installation

You can install the retro-langs package with npm

npm i --save retro-langs

If you want to use the cli everywhere you can add the -g option

CLI

You can follow the instruction of the help command of the cli

retro-langs --help
retro-langs [command] --help

Langs

Watch versions.txt file on DofusRetro CDN

Kind: global class Emits: update, downloaded, watching, error

new Langs(lang, [saveFolder])

Creates an instance of Langs.

Param Type Default Description
lang string Language to watch (if invalid 'fr' is used)
[saveFolder] string "langs" Folder used to save versions.json and swf langs files
build string "prod" lang build type : prod (default), temporis or beta

langs.watch(interval, [downloadNewFiles])

Watch remote versions.txt file

Kind: instance method of Langs

Param Type Default Description
interval number interval in seconds
[downloadNewFiles] boolean false download new swf files on changes

langs.unwatch()

Remove the watcher of the remote versions.txt file

Kind: instance method of Langs

"update"

Langs update event

Kind: event emitted by Langs Properties

Name Type Description
lang string Language
files Array.<string> Array of new files names (without extension)
build string lang build type

"downloaded"

Lang downloaded event

Kind: event emitted by Langs Properties

Name Type Description
lang string Language
file string File name (without extension)
path string Full path of the downloaded file
build string lang build type

"watching"

Start watching langs event

Kind: event emitted by Langs Properties

Name Type Description
lang string Language
interval number interval in seconds
saveFolder string Full path of the downloading directory
downloadNewFiles boolean download new swf files
build string lang build type

"error"

Error event

Kind: event emitted by Langs Properties

Name Type Description
error error Error message

Exemple

const Langs = require('retro-langs');
/**
* Watched language is fr
* Working directory is ./output/dir/
* Lang build type is temporis (can also be 'beta' or 'prod' by default)
*/
const langWatcher = new Langs('fr', 'output/dir', 'temporis');

langWatcher.on('update', ({ lang, files, build }) => {
  // an update of langs is available
});

langWatcher.on('downloaded', ({ lang, file, path, build }) => {
  // a lang file has been downloaded
});

/**
* Watch every 60s
* Will be downloading every new files on changes
*/
langWatcher.watch(60, true); 

retro-langs's People

Watchers

H3r3zy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.