Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zeelib

Package Overview
Dependencies
Maintainers
1
Versions
370
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zeelib

A small lib of FP, Node, and DOM utils.

  • 0.7.20
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

zeelib

A small lib of FP, Node, and DOM utils.

Changes:

  • 0.7.0important — If you've installed in the past eight days (since 0.6.17), you're probably seeing a lot of annoying logs! I did something dumb. Please update!
  • 0.6.0breakingbase64BufferDec and base64BufferEnc are now btoa and atob
  • 0.5.0breakinghexRegex is now a function, getHexRegex
  • 0.4.0breaking — no longer require('zeelib').default, just require('zeelib')
  • 0.2.0breaking — all functions now in top level
    • (No more import { fp } from 'zeelib' to use zipWith, just import { zipWith } from 'zeelib')

Just a load of small utilities.

There's a full list at the bottom of this file.

Documentation is mostly just function names. Sorry.

Usage

import z from 'zeelib'

z.open('http://zacanger.com')
if (z.isEven(process.argv[2])) // do things
z.camelCaseToLispCase('thisString')

You can also import individual functions.

import c from 'zeelib/dist/colorize'

console.log(c.bold(c.blue('HELLO THERE')))

If you're using require with individual files you'll need to use default:

const c = require('zeelib/dist/colorize').default

If you get errors when using zeelib in a front-end build, you may need to use something like Webpack's node option. Try:

node: {
  fs: 'empty',
  net: 'empty',
  tls: 'empty',
  readline: 'empty',
  child_process: 'empty'
}

Or, just import the functions you need (like import words from 'zeelib/dist/words').

License

WTFPL

Contributing

  • This project uses Flow.
  • Please run npm test.
  • If you can, please add a test.
  • Please add your thing in these places:
    • src/index.js in the appropriate place
    • The full list below
  • Make sure you run npm run build
    • (This also runs test, which also runs flow and eslint)

Full list:

dom

  • getCookie
  • getElementPosition
  • getHeight
  • getIsBrowser
  • getLengthOfElements
  • getReferrer
  • getScrollBarWidth
  • getWidth
  • restoreScrollPosition
  • scrollTop

regex, string utils, etc.

  • abbrev
  • abbrevNumber
  • addCommasToNumber
  • addNewlines
  • alphaNumericOnly
  • camelCaseToLispCase
  • camelCaseToPascalCase
  • camelCaseToSnakeCase
  • capitalizeFirstChar
  • collapseNewlines
  • collapseWhitespace
  • combineRegex
  • cssToJson
  • escapeForXpath
  • escapeHtml
  • fixWindowsSlashes
  • formatMs
  • getComplimentaryColors
  • getHexRegex
  • getQueryFromSearch
  • getRandomHex32
  • getRandomString
  • getRegexFlags
  • getUid4
  • getUid8
  • indenter
  • inlineString
  • isAlphaNumeric
  • isEmoji
  • isEmptyString
  • isHexBased
  • isMobileOrTablet
  • isStringSomewhereInArray
  • isValidEmail
  • isValidHex
  • isValidRegex
  • lightenOrDarken
  • lispCaseToCamelCase
  • lispCaseToPascalCase
  • lispCaseToSnakeCase
  • minifyString
  • moustache
  • newlinesToSpaces
  • normalizeClassname
  • normalizeColor
  • normalizeText
  • pascalCaseToCamelCase
  • pascalCaseToLispCase
  • pascalCaseToSnakeCase
  • randomColor
  • removeNewlines
  • removeNonAlpha
  • removeNonAlphaNumeric
  • removeNonAscii
  • removeNonNumeric
  • removeNumeric
  • removeTags
  • removeWhitespace
  • rgbToHex
  • rot13
  • snakeCaseToCamelCase
  • snakeCaseToLispCase
  • snakeCaseToPascalCase
  • stripHref
  • stripPunctuation
  • stripSubdomain
  • toHttp
  • toHttps
  • trimHash
  • trimSpaces
  • truncate
  • unescapeHtml

node

  • atob
  • btoa
  • checkForFile
  • colorize
  • execute
  • findPort
  • getArgs
  • getDiskUsage
  • getFreeMemory
  • getHashFromSystem
  • getHostname
  • getIsNode
  • getLoadAverage
  • getMemoryUsage
  • getNodeModules
  • getPlatform
  • getTerminalColumns
  • getTerminalRows
  • getTerminalSize
  • getUserHome
  • getUserShell
  • hasColor
  • isDirectory
  • isFile
  • isInstalled
  • isSymLink
  • logWithInfo
  • makeFileIfNoFile
  • notFound
  • open
  • readFileSync
  • readJson
  • readJsonSync
  • termPrompt
  • timeRequire
  • tinyRouter
  • watch
  • writeError
  • writeJson
  • writeJsonSync

fp utils

  • all
  • and
  • any
  • apply
  • caar
  • cadr
  • car
  • cdr
  • clone
  • compose
  • concat
  • concatMap
  • cons
  • constant
  • curry
  • curry2
  • curry3
  • curry4
  • drop
  • dropWhere
  • dropWhile
  • each
  • elem
  • eq
  • filter
  • findIndex
  • findWhere
  • flip
  • foldl
  • foldl1
  • foldr
  • foldr1
  • getFunctionArguments
  • head
  • id
  • init
  • invoke
  • last
  • length
  • lines
  • map
  • memoize
  • mix
  • not
  • notElem
  • once
  • or
  • pair
  • pick
  • pipe
  • pluck
  • propEq
  • reduce
  • replicate
  • reverse
  • span
  • splitAt
  • tail
  • take
  • takeLast
  • takeWhile
  • uncurry
  • unfold
  • unlines
  • unwords
  • unzip
  • unzip3
  • where
  • words
  • zip
  • zip3
  • zipThen
  • zipWith
  • zipWith3

types

  • isArray
  • isArrayLike
  • isBoolean
  • isBuffer
  • isDate
  • isDefined
  • isDomElement
  • isEmpty
  • isError
  • isEven
  • isFloat
  • isFunction
  • isInteger
  • isJson
  • isNan
  • isNegative
  • isNodeList
  • isNull
  • isNullOrUndefined
  • isNumber
  • isObject
  • isObjectEqual
  • isOdd
  • isPositive
  • isPow2
  • isPrimitive
  • isPromise
  • isRegExp
  • isString
  • isSymbol
  • isType
  • isUndefined
  • objectToString
  • toType
  • typeOf

misc

  • ago
  • assert
  • average
  • chunk
  • clamp
  • cloneWithout
  • contains
  • copy
  • copyWithout
  • countItemsInArray
  • debounce
  • deepCopy
  • diff
  • dir
  • doubleUntil
  • filterFloat
  • flatten
  • flattenAndUniq
  • generateSequence
  • getBrokenImage
  • getKeyByValue
  • getKeyCodes
  • getLengthOfCharactersInString
  • getLengthOfItemsInArray
  • getNiceDate
  • getNow
  • getOrdinal
  • getTitle
  • getTransparentGif
  • greater
  • greatestCommonDivisor
  • inherits
  • intersection
  • invoker
  • isObjectEmpty
  • keys
  • leastCommonMultiple
  • leftPad
  • lesser
  • levenshteinDistance
  • lexSort
  • logWithTimestamp
  • makeThunk
  • maximum
  • maybeArgs
  • merge
  • minimum
  • nco
  • noSwitch
  • noop
  • objectAssign
  • objectClone
  • objectFromEntries
  • objectInherit
  • product
  • range
  • reverseDigits
  • scaleToFit
  • setTitle
  • shallowCopy
  • shuffle
  • sizeOf
  • sleep
  • splitStringOn
  • sum
  • tap
  • throttle
  • throwError
  • timeTest
  • toMap
  • transpose
  • transposeFlat
  • tryExecNTimes
  • uniq
  • unless
  • xor

Keywords

FAQs

Package last updated on 20 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc