1.0.1 • Published 7 years ago
uson.js v1.0.1
USON
USON :: Universal types included JSON.
- boolean
- number
- string
- array
- Date
- function
- prototype
USON는 UPPERCASE-CORE를 기반으로 만들어졌습니다.
사용 방법
Node.js 환경
npm install -s uson.js
require('uson.js');
웹 브라우저 환경
<script src="UPPERCASE-CORE/BROWSER.js"></script>
<script src="USON.js"></script>
<script>
'use strict';
RUN(() => {
INIT_OBJECTS();
let data = {
msg : 'test',
date : new Date(),
func : () => {
console.log('ok!');
}
};
// where are date and func?
console.log(JSON.parse(JSON.stringify(data)));
// work correct.
console.log(USON.parse(USON.stringify(data)));
// ok!
USON.parse(USON.stringify(data)).func();
});
</script>