DoneJS StealJS jQuery++ FuncUnit DocumentJS
4.3.0
5.0.0 3.13.1 2.3.35
  • About
  • Guides
  • API Docs
  • Community
  • Contributing
  • Bitovi
    • Bitovi.com
    • Blog
    • Design
    • Development
    • Training
    • Open Source
    • About
    • Contact Us
  • About
  • Guides
  • API Docs
    • Observables
      • can-bind
      • can-compute
      • can-debug
      • can-define
      • can-define/list/list
      • can-define/map/map
      • can-define-backup
      • can-define-stream
      • can-define-stream-kefir
      • can-event-queue
      • can-kefir
      • can-list
      • can-map
      • can-map-define
      • can-observation
      • can-observation-recorder
      • can-observe
      • can-simple-map
      • can-simple-observable
      • can-stream
      • can-stream-kefir
      • can-value
    • Data Modeling
      • can-connect
      • can-connect-feathers
      • can-fixture
      • can-fixture-socket
      • can-ndjson-stream
      • can-set
    • Views
      • can-component
      • can-stache
      • can-stache-bindings
      • can-stache-converters
      • can-stache-route-helpers
      • can-view-autorender
      • can-view-callbacks
      • can-view-import
      • can-view-live
      • can-view-model
      • can-view-nodelist
      • can-view-parser
      • can-view-scope
      • can-view-target
      • react-view-model
      • react-view-model/component
      • steal-stache
    • Routing
      • can-deparam
      • can-param
      • can-route
      • can-route-hash
      • can-route-mock
      • can-route-pushstate
    • JS Utilities
      • can-assign
      • can-define-lazy-value
      • can-diff
      • can-globals
      • can-join-uris
      • can-key
      • can-key-tree
      • can-make-map
      • can-parse-uri
      • can-queues
      • can-string
      • can-string-to-any
      • can-util
        • can-util/js
          • ./assign-non-enumerable/
          • ./deep-assign/
          • ./defaults/
          • ./diff/
          • ./diff-array/
          • ./diff-object/
          • ./each/
          • ./get/
          • ./import/
          • ./is-array-like/
          • ./is-empty-object/
          • ./is-function
          • ./is-node/
          • ./is-plain-object/
          • ./is-promise/
          • ./is-promise-like/
          • ./is-web-worker/
          • ./join-uris/
          • ./make-array/
          • ./make-map/
          • ./make-promise/
          • ./omit/
          • ./set-immediate/
          • ./string/
          • ./string-to-any/
        • can-util/dom
          • ./attr/
          • ./child-nodes/
          • ./class-name/
          • ./data/
          • ./dispatch/
          • ./events/
          • ./frag/
          • ./mutate/
        • deprecated
          • ./dom/ajax/
          • ./dom/events/enter/
          • ./js/assign/
          • ./js/cid/
          • ./js/cid-map/
          • ./js/cid-set/
          • ./js/deparam/
          • ./js/dev/
          • ./js/document/
          • ./js/global/
          • ./js/is-browser-window/
          • ./js/is-string/
          • ./js/location/
          • ./js/log/
          • ./js/mutation-observer/
          • ./js/param/
          • ./js/parse-uri/
          • ./js/types/
      • can-zone
      • can-zone-storage
    • DOM Utilities
      • can-ajax
      • can-attribute-encoder
      • can-child-nodes
      • can-control
      • can-dom-data
      • can-dom-events
      • can-dom-mutate
      • can-event-dom-enter
      • can-event-dom-radiochange
      • can-fragment
    • Data Validation
      • can-define-validate-validatejs
      • can-validate
      • can-validate-interface
      • can-validate-legacy
      • can-validate-validatejs
    • Typed Data
      • can-cid
      • can-construct
      • can-construct-super
      • can-data-types
      • can-namespace
      • can-reflect
      • can-reflect-dependencies
      • can-reflect-promise
      • can-types
    • Polyfills
      • can-symbol
      • can-vdom
    • Core
    • Infrastructure
      • can-global
      • can-test-helpers
    • Ecosystem
    • Legacy
  • Community
  • Contributing
  • GitHub
  • Twitter
  • Chat
  • Forum
  • News
Bitovi

can-util

  • npm package badge
  • Star
  • Edit on GitHub

Common JavaScript utilities for the rest of CanJS.

Object

can-util/js

  • [can-util/js/base-url/base-url] - Get and/or set the "base" (containing path) of the document.
  • deep-assign - Assign properties from a source object to a target object, deeply copying properties that are objects or arrays.
  • defaults - Mimics _.defaults. Assigns first level properties in sources from left to right if they are not already defined.
  • diff - Returns the difference between two ArrayLike objects (that have nonnegative integer keys and the length property) as an array of patch objects.
  • diff-object - Find the differences between two objects, based on properties and values.
  • each - Loop over each element in an Array-Like data structure.
  • get - Returns the value at the specified property path of an object.
  • import - Imports a module.
  • is-array-like - Determines if an object is "array like", meaning it can be looped over. Any object with a .length property is array like.
  • is-empty-object - Used to determine if an object is an empty object (an object with no enumerable properties) such as {}.
  • [can-util/js/is-function/is-function] - Used to determine if a value is a function.
  • is-node - Determines if your code is running in Node.js.
  • is-plain-object - Attempts to determine if an object is a plain object like those you would create using the curly braces syntax: {}.
  • is-promise - Determines if object is a Promise.
  • is-promise-like - Determines if an object is "Then-able".
  • is-web-worker - Determines if the code is running with a Web Worker.
  • join-uris - Provides a convenient way to join together URIs handling relative paths.
  • make-array - Takes any array-like object (can-list, NodeList, etc.) and converts it to a JavaScript array.
  • make-promise - Will make isPromiseLike object into Promise.
  • omit - Omit properties from an object.
  • set-immediate - Polyfill for setImmediate() if it doesn't exist in the global context.
  • string - String utilities used by CanJS libraries.
  • string-to-any - Turns a string representation of a primitive type back into the associated primitive.

can-util/dom

  • attr - A module that makes it easy to access attributes and properties of elements.
  • child-nodes - Get all of the childNodes of a given node.
  • class-name - Allows querying and manipulation of classes on HTML elements.
  • data - Allows associating data as a key/value pair for a particular DOM node.
  • dispatch - Dispatch an event on an element.
  • events - Allows you to listen to a domEvent and special domEvents as well as dispatch domEvents.
  • frag - Convert a String, HTMLElement, documentFragment, or contentArray into a documentFragment.
  • mutate - Mutate an element by appending, inserting, and removing DOM nodes. Use this so that on the server "inserted" will be fired.

deprecated

  • ajax - Deprecated. Use can-ajax instead.
  • assign - Deprecated. Use can-assign instead.
  • cid - Deprecated. Use can-cid instead.
  • deparam - Deprecated. Use can-deparam instead.
  • dev - Deprecated. Use [can-log/dev/dev] instead.
  • [can-util/dom/document/document] - Deprecated. Use document instead.
  • global - Deprecated. Use global instead.
  • is-browser-window - Deprecated. Use is-browser-window instead.
  • is-string - Deprecated. Use typeof instead.
  • log - Deprecated. Use log instead.
  • param - Deprecated. Use can-param instead.
  • types - Deprecated. Use can-types instead.

CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 4.3.0.

On this page

Get help

  • Chat with us
  • File an issue
  • Ask questions
  • Read latest news