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

@localazy/ts-api

v1.1.0

Published

This is a Typescript library facilitating usage of Localazy's API.

Downloads

2,069

Readme

@localazy/ts-api

This is a Typescript library facilitating usage of Localazy's API. To better understand this library, it is recommended to study the API documentation first.

Installation and usage

To install this library, run the following command

npm i @localazy/ts-api

Afterwards, import the library and initialize it.

import LocalazyApi from '@localazy/ts-api';

const api = LocalazyApi({
    projectToken: "your-project-token"
    // ...additional options
})

Project token

In order to access anything from Localazy, you need to sign up and create a project.

Then, you'll be able to generate a project token here.

See documentation for more information.

Base url

Optional baseUrl parameter. Add prefix for all api calls. Useful for proxying requests.

Methods overview

listProjects

List projects related to the project token.

async listProjects(options: ListProjects = {}, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/projects#list-projects

import

Import content into Localazy.

async import(options: Import, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/import

listFormats

Retrieve list of available file formats and related options.

async listFormats(config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/import#retrieve-a-list-of-available-file-types

listFiles

List Localazy files.

async listFiles(options: ListFiles, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/files

getFileContents

Returns the given file contents.

async getFileContents(options: DownloadFile, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/files

listKeysInFileForLanguage

This is the main method for retrieving translated content from given project and localazy file for given language.

async listKeysInFileForLanguage(options: ListKeysInFile, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/files#retrieve-a-list-of-keys-and-translations-from-file

webhooks

Returns the webhooks configuration for the given project.

async listWebhooks(options: ListWebhooks, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/webhooks-api#list-webhooks-configuration

postWebhooks

Store a new webhooks configuration for the project.

async postWebhooks(options: PostWebhooks, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/webhooks-api#update-webhooks-configuration

listScreenshots

List all screenshots for the given project.

async listScreenshots(options: ListScreenshots, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/screenshots

listScreenshotsTags

List all existing tags for screenshots.

async listScreenshotsTags(options: ListScreenshotsTags, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/screenshots

postScreenshots

Upload a new screenshot.

async postScreenshots(options: PostScreenshots, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/screenshots

postScreenshot

Change image data of existing screenshot.

async postScreenshot(options: PostScreenshot, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/screenshots

putScreenshot

Change existing screenshot.

async putScreenshot(options: PutScreenshot, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/screenshots

deleteScreenshot

async deleteScreenshot(options: DeleteScreenshot, config: CommonConfig = {})

Documentation: https://localazy.com/docs/api/screenshots

FAQ

Localazy's API supports method that is not included in this library.

It's possible as the API is still actively developed and it might take us some time to update all related projects. Feel free to create a new issue or pull request for this.

I'd like to import and use a type definition for one of the methods. Can I do that?

Yes. We publish type definitions for arguments of all the methods to NPM. They reside in @localazy/ts-api/dist/models, e.g.

import ListProjects from "@localazy/ts-api/dist/models/arguments/list-projects";