4.35.1 • Published 1 year ago

@cpmech/basic v4.35.1

Weekly downloads
15
License
MIT
Repository
github
Last release
1 year ago

Basic JS (TypeScript) functions

This repo implements some basic/auxiliary/helper Javascript (Typescript) code.

Installation

npm install @cpmech/basic

Example

import { camelize } from '@cpmech/basic';
console.log(camelize('dorival_pedroso'));
// dorivalPedroso

Using Locales

Directory structure

src/locale
  |_ en.ts
  |_ index.ts
  |_ pt.ts

English definitions

// en.ts
export const en = {
  signIn: {
    title: 'Sign In',
  },
};

Portuguese definitions

// pt.ts
export const pt = {
  signIn: {
    title: 'Entrar',
  },
};

Main file

// index.ts
import { Locales } from '@cpmech/basic';
import { en } from './en';
import { pt } from './pt';

const res = {
  en,
  pt,
};

const loc = new Locales(res, 'pt', 'br');

export const t = loc.translate;

Usage

import { t } from 'locale';

console.log(t('signIn.title'));
// Entrar
4.35.1

1 year ago

4.33.0

3 years ago

4.32.0

3 years ago

4.31.0

3 years ago

4.30.0

3 years ago

4.29.0

4 years ago

4.28.0

4 years ago

4.27.0

4 years ago

4.26.0

4 years ago

4.25.0

4 years ago

4.24.0

4 years ago

4.23.0

4 years ago

4.22.1

4 years ago

4.22.0

4 years ago

4.21.0

4 years ago

4.20.1

5 years ago

4.20.0

5 years ago

4.19.0

5 years ago

4.18.0

5 years ago

4.17.0

5 years ago

4.16.0

5 years ago

4.15.0

5 years ago

4.14.0

5 years ago

4.13.0

5 years ago

4.12.0

5 years ago

4.11.0

5 years ago

4.10.0

5 years ago

4.9.0

5 years ago

4.8.0

5 years ago

4.7.0

5 years ago

4.6.0

5 years ago

4.5.0

5 years ago

4.4.0

5 years ago

4.3.0

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

3.24.0

5 years ago

3.23.0

5 years ago

3.22.0

5 years ago

3.21.0

5 years ago

3.20.0

5 years ago

3.19.0

5 years ago

3.18.0

5 years ago

3.17.0

5 years ago

3.16.0

5 years ago

3.15.0

5 years ago

3.14.0

5 years ago

3.13.0

5 years ago

3.12.0

5 years ago

3.11.0

5 years ago

3.10.0

5 years ago

3.9.0

5 years ago

3.8.0

5 years ago

3.7.0

5 years ago

3.6.0

5 years ago

3.5.0

5 years ago

3.4.0

5 years ago

3.3.0

5 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.16.0

5 years ago

2.15.0

5 years ago

2.13.0

5 years ago

2.12.0

5 years ago

2.11.0

5 years ago

2.10.0

5 years ago

2.9.1

5 years ago

2.9.0

5 years ago

2.8.0

5 years ago

2.7.0

5 years ago

2.6.0

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.1.10

5 years ago

1.0.0

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.0

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago