Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skpm/util
A drop-in replacement for the util NodeJS module
https://github.com/skpm/util
nodejs polyfill sketch
Last synced: about 2 months ago
JSON representation
A drop-in replacement for the util NodeJS module
- Host: GitHub
- URL: https://github.com/skpm/util
- Owner: skpm
- License: mit
- Created: 2018-02-22T09:08:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:03:51.000Z (about 2 years ago)
- Last Synced: 2024-11-07T08:51:47.034Z (2 months ago)
- Topics: nodejs, polyfill, sketch
- Language: JavaScript
- Size: 1.48 MB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `util` for Sketch
All the [util nodejs](https://nodejs.org/api/util.html) API is available.
Additionally, 5 more methods are available:
- `isNativeObject`: return whether the argument is a native objc object
- `getNativeClass`: return the class name of a native object
- `toArray`: cast assimilated arrays (`NSArray`) to a proper JS array
- `toObject`: cast assimilated objects (`NSDictionary`) to a proper JS object
- `toJSObject`: cast any object or primitive into its proper JS counterpart. Note that `NSDictionary` and `NSArray` elements are not recursively converted unless an `options` object is passed as the second argument and `options.recurse` is set to `true`_Because of CocoaScript, `isNull` is not going to work._