1.0.2 • Published 5 years ago

pick-from-lodash v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

This is a joke but not the "haha" type

Tired of writting things like these?

const {
    REACT_APP_API_KEY,
    REACT_APP_AUTH_DOMAIN,
    REACT_APP_DATABASE_URL,
    REACT_APP_PROJECT_ID,
    REACT_APP_STORAGE_BUCKET,
    REACT_APP_MESSAGING_SENDER_ID
} = process.env

const config = {
    apiKey: REACT_APP_API_KEY,
    authDomain: REACT_APP_AUTH_DOMAIN,
    databaseURL: REACT_APP_DATABASE_URL,
    projectId: REACT_APP_PROJECT_ID,
    storageBucket: REACT_APP_STORAGE_BUCKET,
    messagingSenderId: REACT_APP_MESSAGING_SENDER_ID
}

Write like this!

const pick = require('./index')

const config = pick(process.env,
    'REACT_APP_API_KEY',
    'REACT_APP_AUTH_DOMAIN',
    'REACT_APP_DATABASE_URL',
    'REACT_APP_PROJECT_ID',
    'REACT_APP_STORAGE_BUCKET',
    'REACT_APP_MESSAGING_SENDER_ID'
)

The original name was different but NPM is smart and didn't allow me to publish that

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago